<\\/div>\\\"\\n\\/>\"', 1, '2024-09-14 02:58:38', '2024-09-14 02:57:23', 1, 0, 1075, '639e63b1-a63d-4d40-853f-42e7b28a5d35', '', '', '', '', NULL),
+(3427, 0, 0, 0, 0, '', '', '', '', 255, '', 'VARCHAR', 2, '', '', 'Confirm Password2', 'NULL', 0, '0022598d-0ee1-44f2-aa94-c2eb47595f73', '\"
\"', 1, '2024-09-15 22:31:43', '2024-09-15 22:32:42', 2, 0, 884, '27c39335-cd12-46a5-82e7-26d3c67b9bb6', '', '', '', '', NULL),
+(3428, 0, 0, 0, 0, '', '', '', '', 255, '', 'VARCHAR', 2, '', '', 'File Type', 'NULL', 0, 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a', '\"
\"', 1, '2024-09-15 23:26:41', '2024-09-15 23:29:05', 2, 0, 1078, 'c2f884f9-31a0-4bb9-8310-64b5d9132d32', '', '', '', '', NULL),
+(3429, 0, 0, 0, 0, '', '', 'Other', '0000-00-00', '', '', 'DATE', 0, '', '', 'Date of Birth (not required)', 'NOT NULL', 0, '6cf5a33f-cb25-4a58-bfec-7e1511896402', '\"
\"', 1, '2024-09-16 23:29:21', '2024-09-16 23:29:35', 2, 0, 649, 'c8cc2a22-f2e4-4dcc-9088-ed1d78416228', '', '', '', '', NULL),
+(3430, 0, 0, 0, 0, '', '', '', '', '', '', 'TEXT', '', '', '', 'Messages', 'NULL', 0, '76fe1250-6fa7-49e5-a0ee-f06d8d4c9f99', '\"
\"', 1, '2025-02-16 17:28:48', '2025-02-16 17:29:45', 3, 0, 1081, 'c6e1e451-99b8-4e1b-aa19-c48c3513bf4f', NULL, NULL, '', '', NULL),
+(3431, 0, 0, 0, 0, '', '', 1, '', 1, '', 'TINYINT', 2, '', '', 'Message Status', 'NULL', 0, 'a51dfc06-1b9b-4d0a-86ba-f705bcd40d4d', '\"
\"', 1, '2025-02-16 17:32:30', '2025-02-16 17:33:56', 2, 0, 1082, '0f4fa86e-25a8-4bbf-91a3-7ea9790b4df8', NULL, NULL, '', '', NULL),
+(3432, 0, 0, 0, 0, '', '', '', '', '', '', 'TEXT', '', '', '', 'Map', 'NULL', 0, '7139f2c8-a70a-46a6-bbe3-4eefe54ca515', '\"
\"', 1, '2025-02-16 18:37:19', '2025-02-16 18:51:37', 3, 0, 1083, '2d0566ab-cfbe-4ca2-8d05-8e2c70eda191', NULL, NULL, '', '', NULL),
+(3433, 0, 0, 0, 0, '', '', '', '', 255, '', 'VARCHAR', 2, '', '', 'Column', 'NULL', 0, 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a', '\"
\"', 1, '2025-02-16 18:41:54', '2025-02-16 18:47:04', 2, 0, 1084, '6a17f5e4-d21e-47f1-9b92-493ab725d55f', NULL, NULL, '', '', NULL),
+(3434, 0, 0, 0, 0, '', '', '', '', 255, '', 'VARCHAR', 2, '', '', 'Target Field', 'NULL', 0, 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a', '\"
\"', 1, '2025-02-16 18:50:25', '2025-02-21 14:26:33', 2, 0, 1085, '7d613846-8f1e-43f4-8bb9-1fcdbb473fa5', NULL, NULL, '', '', NULL),
+(3435, 0, 0, 0, 0, '', '', '', '', 'Other', 36, 'VARCHAR', 2, '', '', 'File (Importer)', 'NULL', 0, 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a', '\"
\"', 1, '2025-02-16 18:54:56', '2025-02-16 19:17:19', 3, 0, 1086, '91939b1a-c4d6-4531-8356-63bc4ca243fb', NULL, NULL, '', '', NULL),
+(3436, 0, 0, 0, 0, '', '', '', '', 11, '', 'INT', 2, '', '', 'Import Status', 'NULL', 0, 'a51dfc06-1b9b-4d0a-86ba-f705bcd40d4d', '\"
\"', 1, '2025-02-16 19:00:55', '2025-02-16 19:01:01', 2, 0, 1087, '11698dc6-8ff6-4662-b3b7-e47494463a08', NULL, NULL, '', '', NULL);
--
-- Dumping data for table `#__componentbuilder_fieldtype`
--
-
INSERT INTO `#__componentbuilder_fieldtype` (`id`, `description`, `name`, `properties`, `short_description`, `params`, `published`, `version`, `hits`, `ordering`, `guid`) VALUES
-(1, 'The calendar form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box.', 'Calendar', '{\"properties0\":{\"name\":\"type\",\"example\":\"calendar\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be calendar.\"},\"properties1\":{\"name\":\"name\",\"example\":\"date\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a date\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"NOW\",\"adjustable\":\"1\",\"description\":\"(optional) is the default date. This must be given in the same format as specified by the format argument. You can put \\\"NOW\\\" to have current time.\"},\"properties4\":{\"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 text box.\"},\"properties5\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether the text box is read-only (true or false). If the text box is read-only, the date cannot be changed, but can be selected and copied. No calendar icon will be shown.\"},\"properties6\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether the text box is disabled (true or false). If the text box is disabled, the date cannot be changed, selected or copied.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"format\",\"example\":\"%d-%m-%Y\",\"adjustable\":\"1\",\"description\":\"(optional) is the date format to be used. This is in the format used by PHP to specify date string formats (see below). If no format argument is given, \'%Y-%m-%d\' is assumed (giving dates like \'2008-04-16\').\"},\"properties9\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is time zone to be used. There are two values; server_utc and user_utc. The first one is server time zone and the later is user time zone as configured in global configuration and user information respectively.\"},\"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.\"},\"properties11\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties12\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional)\"},\"properties13\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties14\":{\"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\"},\"properties15\":{\"name\":\"translateformat\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): If set to true, the calendar will use a language string to determine the format. The `format` attribute is ignored. If false, the `format` attribute is used (same behaviour as today). (starting with 3.7.0)\"},\"properties16\":{\"name\":\"showtime\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): If set to true and translateformat is true, the language key DATE_FORMAT_CALENDAR_DATETIME is used, otherwise DATE_FORMAT_CALENDAR_DATE. (starting with 3.7.0)\"},\"properties17\":{\"name\":\"timeformat\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): can be set to 12 (and specify AM or PM) or 24 (starting with 3.7.0)\"},\"properties18\":{\"name\":\"singleheader\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to false, the year and the month selection will be set on two separates lines, with independant selection (starting with 3.7.0)\"},\"properties19\":{\"name\":\"todaybutton\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, a button is added at the bottom of the datePicker to select the date of the current day (starting with 3.7.0)\"},\"properties20\":{\"name\":\"weeknumbers\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, a column is added at the left of the datePicker to display the number of the week in the current year (starting with 3.7.0)\"},\"properties21\":{\"name\":\"filltable\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, dates of the previous and next month is added at the top and the bottom of the current month to fill the grid (starting with 3.7.0)\"},\"properties22\":{\"name\":\"minyear\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user could not select a year before your limit (starting with 3.7.0)\"},\"properties23\":{\"name\":\"maxyear\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user could not select a year after your limit (starting with 3.7.0)\"}}', 'provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.', '{\"source\":{\"618e8916-4028-4d5b-b85c-970304685913-settings\":\"6ae1ea0dac5b29ee5cb356c6f17fe14562366587\",\"618e8916-4028-4d5b-b85c-970304685913-readme\":\"c9eeddeadaced241e8e7289a1c7ac591d731043f\"}}', 1, 11, '', '', '6cf5a33f-cb25-4a58-bfec-7e1511896402'),
-(2, 'The category form field type provides a drop down list of all published categories for a certain extension. 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. If the show_root', 'Category', '{\"properties0\":{\"name\":\"type\",\"example\":\"category\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be category.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mycategory\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a category\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"extension\",\"example\":\"com_content\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the name of the extension for which the categories will be retrieved. For example, to list content categories, use the value \'com_content\'. You can add also target one view, use the value \'com_component.view\'.\"},\"properties4\":{\"name\":\"scope\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is an alias for extension.\"},\"properties5\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"show_root\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) is whether a choice representing the root category will be shown. Remove completely if it is not to be shown.\"},\"properties7\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default category ID number.\"},\"properties8\":{\"name\":\"description\",\"example\":\"select one of the following categories\",\"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.\"},\"properties9\":{\"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\'.\"},\"properties10\":{\"name\":\"published\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) (1\\/0\\/2\\/-2) is whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories. It is possible to combine different publishing status by entering the list of the corresponding numbers separated by comma (e.g. \\\"0,2,-2\\\" will display only unpublished, archived and trashed categories in the drop-down).\"},\"properties11\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"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\"}}', 'provides a drop down list of categories for an extension.', '', 1, 13, '', '', 'f70346b3-2096-4f44-8b26-01ab87da7d1e'),
-(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. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (JavaScript use)\"}}', 'provides a single checkbox to be checked or unchecked', '', 1, 7, '', '', '10066262-b6e3-4f82-941e-cbe4f61ddd6c'),
-(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\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkboxs\"},\"properties1\":{\"name\":\"name\",\"example\":\"toppings\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select Toppings\",\"adjustable\":\"1\",\"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\",\"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\",\"description\":\"(optional) is the default value.\"},\"properties5\":{\"name\":\"description\",\"example\":\"Select the topping of your choice\",\"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.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"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. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides unlimited checkboxes that can be used for multi-select.', '', 1, 4, '', '', 'ac10859b-58da-4584-9682-36a6c2c8d04d'),
-(5, 'Provides a color picker. Enter the color as #ff00ff or pick it from the palet.', 'Color', '{\"properties0\":{\"name\":\"type\",\"example\":\"color\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be color.\"},\"properties1\":{\"name\":\"name\",\"example\":\"backgroundcolor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"default\",\"example\":\"#FFFFFF\",\"adjustable\":\"1\",\"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\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"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\"}}', 'provides a color picker when clicking the input box.', '', 1, 5, '', '', '7f60f198-53e7-4fe9-813f-d1b6c553680e'),
-(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. 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\'.\"},\"properties6\":{\"name\":\"layout\",\"example\":\"joomla.form.field.list-fancy-select\",\"adjustable\":\"1\",\"description\":\"(optional) New layout field added in Joomla 4\"},\"properties7\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties8\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties9\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"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.\"},\"properties11\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"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\"},\"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\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties15\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties16\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"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.\"},\"properties18\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties25\":{\"name\":\"entity\",\"example\":\"fieldtype\",\"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.\"},\"properties20\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"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.\"},\"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.\"},\"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\"},\"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\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 31, '', '', 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a'),
-(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\",\"mandatory\":\"1\",\"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\",\"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\",\"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\",\"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\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"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\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"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\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"mandatory\":\"1\",\"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\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"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.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\t\\t\\/\\/ set the groups array\\r\\n\\t\\treturn ComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties22\":{\"name\":\"type_phpx_1\",\"example\":\"\\t\\t\\/\\/ To ensure that there is only one record per user\\r\\n\\t\\t\\/\\/ Get a db connection.\\r\\n\\t\\t$db = Factory::getDbo();\\r\\n\\t\\t\\/\\/ Create a new query object.\\r\\n\\t\\t$query = $db->getQuery(true);\\r\\n\\t\\t\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\\r\\n\\t\\t$query->select($db->quoteName(\'###CODE###\'));\\r\\n\\t\\t$query->from($db->quoteName(\'#__###component###_###view###\'));\\r\\n\\t\\t$db->setQuery($query);\\r\\n\\t\\t$db->execute();\\r\\n\\t\\t$found = $db->getNumRows();\\r\\n\\t\\tif ($found)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ return all users already used\\r\\n\\t\\t\\treturn array_unique($db->loadColumn());\\r\\n\\t\\t}\\r\\n\\t\\treturn null;\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"}}', 'Provides list of users.', '', 1, 6, '', '', 'a4a39f70-070f-459c-be4b-0ac103a29b9a'),
-(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.\"},\"properties4\":{\"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 label.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties7\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties8\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties9\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties10\":{\"name\":\"buttons\",\"example\":\"no\",\"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.\"},\"properties11\":{\"name\":\"syntax\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) can be used to set the code syntax matching for this field.\"},\"properties12\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties13\":{\"name\":\"editor\",\"example\":\"codemirror|none\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties14\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties15\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties16\":{\"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.\"},\"properties17\":{\"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\"}}', 'provides an editor area field.', '', 1, 12, '', '', '51f288d2-6eaa-42bc-a182-a6f69b3032b8'),
-(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, '', '', '82f1b5ca-bb9b-44d7-9a7a-9a03fb2a31dd'),
-(10, 'The integer form field type provides a select box with a range of integer values. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Integer', '{\"properties0\":{\"name\":\"type\",\"example\":\"integer\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be integer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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.\"},\"properties9\":{\"name\":\"first\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties10\":{\"name\":\"last\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties11\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"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)\"}}', 'provides a drop down list of integers between a minimum and maximum.', '', 1, 6, '', '', 'fdbb50ea-35d2-45b2-a0bc-076fdf1544b8'),
-(11, 'The list form field type provides a drop down list or a list box of custom-defined 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.', 'List', '{\"properties0\":{\"name\":\"type\",\"example\":\"list\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be list.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mylist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"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\":\"layout\",\"example\":\"joomla.form.field.list-fancy-select\",\"adjustable\":\"1\",\"description\":\"(optional) New layout field added in Joomla 4\"},\"properties7\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties8\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties9\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"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.\"},\"properties11\":{\"name\":\"option\",\"example\":\"0|Option 1,1|Option 2,2|Option 1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties12\":{\"name\":\"useglobal\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties13\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties14\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties15\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 12, '', '', 'a51dfc06-1b9b-4d0a-86ba-f705bcd40d4d'),
-(12, 'The media form field type provides modal access to the media manager for the choice of an image. Users with appropriate permissions will be able to upload files.', 'Media', '{\"properties0\":{\"name\":\"type\",\"example\":\"media\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be media.\"},\"properties1\":{\"name\":\"name\",\"example\":\"media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Media\",\"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\":\"directory\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the directory from which the user will be able to choose a file. This attribute should be relative to the top level \\/images\\/ folder.\"},\"properties5\":{\"name\":\"preview\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) shows or hides the preview of the currently chosen image. (\\\"true\\\": Show always, \\\"tooltip\\\": Show as tooltip, \\\"false\\\": Show never) (since Joomla! 2.5.5)\"},\"properties6\":{\"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\"},\"properties7\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.', '', 1, 5, '', '', '69957007-e3d4-4976-a32b-611d02dbad71'),
-(13, 'Provides a meter to show value in a range, updated with jQuery if needed or simply a fixed value.', 'Meter', '{\"properties0\":{\"name\":\"type\",\"example\":\"meter\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be meter.\"},\"properties1\":{\"name\":\"name\",\"example\":\"meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"width\",\"example\":\"330px\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of meter box\"},\"properties4\":{\"name\":\"color\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The background color\"},\"properties5\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"animated\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) lets the bar have strips\"},\"properties7\":{\"name\":\"active\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) lets the strips on the bar move\"},\"properties8\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"properties9\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties10\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties11\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties12\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"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\"}}', 'Provides a meter to show value in a range.', '', 1, 3, '', '', '81668284-e572-4e17-927b-ba697fc64bd0'),
-(14, 'This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without having to rely on the tooltips). Or adding any other text you want.', 'Note', '{\"properties0\":{\"name\":\"type\",\"example\":\"note\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be note\"},\"properties1\":{\"name\":\"name\",\"example\":\"note_one\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory or optional if using description) (translatable) is the descriptive title of the note \"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional if using label)(translatable) the description\\/text of the note \"},\"properties4\":{\"name\":\"heading\",\"example\":\"h4\",\"adjustable\":\"1\",\"description\":\"(optional) the type of heading element to use for the label (default: h4)\"},\"properties5\":{\"name\":\"class\",\"example\":\"alert\",\"adjustable\":\"1\",\"description\":\"(optional) a class name (or class names), like these examples ( alert, alert alert-info, alert alert-success, alert alert-error )\"},\"properties6\":{\"name\":\"close\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) a value of \'true\' (for alerts) or the value for the data-dismiss of the bootstrap close icon\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'supports a one line text field.', '', 1, 5, '', '', 'f9ecacd0-8481-4157-8c71-d7aaefc2b7c3'),
-(15, 'Provides a one line text box with up-down handles to set a number in the field.', 'Number', '{\"properties0\":{\"name\":\"type\",\"example\":\"number\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be number.\"},\"properties1\":{\"name\":\"name\",\"example\":\"number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"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.\"},\"properties5\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties8\":{\"name\":\"max\",\"example\":\"40\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties9\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this number, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Javascript that should run on changing of the value.\"},\"properties11\":{\"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\"}}', 'Provides a one line text box with up-down handles to set a number in the field.', '', 1, 5, '', '', '5abd2b73-643b-4273-841a-787991aad968'),
-(16, 'The password form field type provides a text box for entry of a password. The password characters will be obscured as they are entered. If the field has a saved value this is entered (in obscured form) into the text box. If not, the default value (if any)', 'Password', '{\"properties0\":{\"name\":\"type\",\"example\":\"password\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be password.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mypassword\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter A Password\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"default\",\"example\":\"secret\",\"adjustable\":\"1\",\"description\":\"(optional) is the default password.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"message\",\"example\":\"Error! Please add password here.\",\"adjustable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"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.\"},\"properties18\":{\"name\":\"rules\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) determines whether the password should adhere to certain rules.\"},\"properties12\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties13\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties14\":{\"name\":\"hint\",\"example\":\"Password Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties15\":{\"name\":\"autocomplete\",\"example\":\"off\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties19\":{\"name\":\"strengthmeter\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) measures the strength of the password.\"},\"properties20\":{\"name\":\"force\",\"example\":\"off\",\"adjustable\":\"1\",\"description\":\"(optional) forces a password to be set.\"},\"properties16\":{\"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\"},\"properties17\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text box for entry of a password. The password characters will be obscured as they are entered.', '', 1, 11, '', '', '0022598d-0ee1-44f2-aa94-c2eb47595f73'),
-(17, 'The radio form field type provides radio buttons to select different options. 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.', 'Radio', '{\"properties0\":{\"name\":\"type\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be radio.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myradiovalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"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\":\"class\",\"example\":\"btn-group btn-group-yesno\",\"adjustable\":\"1\",\"description\":\"(optional) New in Joomla 3, if set to class=\\\"btn-group btn-group-yesno\\\" will show the nice coloured buttons\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|Yes,0|No\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default radio button item value.\"},\"properties7\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"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\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"false\",\"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) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides radio buttons to select different options.', '', 1, 18, '', '', 'b868ed59-4208-4206-8504-95a35a74a11c'),
-(18, 'Provides a horizontal scroll bar to specify a value in a range.', 'Range', '{\"properties0\":{\"name\":\"type\",\"example\":\"range\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be range.\"},\"properties1\":{\"name\":\"name\",\"example\":\"range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties8\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties9\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"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.\"},\"properties12\":{\"name\":\"onchange\",\"example\":\"jQuery(\'#jform_range\').closest(\'.controls\').find(\'span\').remove(); var value = jQuery(\'#jform_range\').val();jQuery(\'#jform_range\').closest(\'.controls\').append(\' \'+value+\'\');\",\"adjustable\":\"1\",\"description\":\"(optional) javascript to run when the range is changed\"},\"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\"}}', 'Provides a horizontal scroll bar to specify a value in a range.', '', 1, 5, '', '', '627d3845-7273-4f75-8e63-7b3a319a42c8'),
-(19, 'Provides a modal with rows of formfields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Repeatable', '{\"properties0\":{\"name\":\"type\",\"example\":\"repeatable\",\"adjustable\":\"1\",\"description\":\"(mandatory) must be repeatable.\"},\"properties1\":{\"name\":\"name\",\"example\":\"repeatable_list\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Repeatable List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"aid\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) id of the hidden from field. (the modal will have this id with an added suffix of \\\"_modal\\\" and the table within the modal will have this id with a suffix of _modal_table\\\")\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) class of the table.\"},\"properties7\":{\"name\":\"select\",\"example\":\"Click here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) The text to show on the modal button.\"},\"properties8\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties9\":{\"name\":\"maximum\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties10\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 5, '', '', '05bf68d4-52f9-4705-8ae7-cba137fce0ad'),
-(20, 'The spacer form field type provides a visual separator between parameter field elements. It is purely a visual aid and no field value is stored.', 'Spacer', '{\"properties0\":{\"name\":\"type\",\"example\":\"spacer\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be spacer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myspacer\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the text to use as a spacer.\"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"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\":\"hr\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is whether to display a horizontal rule (\'true\' or \'false\'). If this attribute is \'true\', the label attribute will be ignored.\"},\"properties5\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"}}', 'provides a visual separator between form fields. It is purely a visual aid and no value is stored.', '', 1, 1, '', '', '626d0cba-a908-4a4f-a447-96d781aeaa0b'),
-(21, 'Using this generic form field type forces you to write SQL in an XML file and is rather limited. For more flexibility, consider using Custom FieldType.\r\n\r\nThe sql form field type provides a drop down list of entries obtained by running a query on the Joom', 'SQL', '{\"properties0\":{\"name\":\"type\",\"example\":\"sql\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be sql.\"},\"properties1\":{\"name\":\"name\",\"example\":\"title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an article\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"query\",\"example\":\"SELECT id, concat( title, \' (\', created, \')\') AS title FROM #__content\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the SQL query which will provide the data for the drop-down list. The query must return two columns; one called \'value\' (unless overridden by the key_field attribute) which will hold the values of the list items; the other called the same as the value of the name attribute (unless overridden by the value_field attribute) containing the text to be shown in the drop-down list.\"},\"properties4\":{\"name\":\"default\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value. This is the value of the \'value\' field, unless overridden by the key_field attribute.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties7\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties8\":{\"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.\"},\"properties9\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"description\":\"(optional) is the name of the column that will contain values for the parameter. If omitted then the column called \'value\' will be used, if it exists.\"},\"properties10\":{\"name\":\"value_field\",\"example\":\"title\",\"adjustable\":\"1\",\"description\":\"(optional) is the name of the column that will contain values to be shown to the user in the drop-down list. If omitted then the column with the same name as the name attribute will be used, if it exists.\"},\"properties11\":{\"name\":\"translate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) will translate the output of the value_field if set to true. It defaults to false.\"},\"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\"}}', 'provides a drop down list of entries obtained by running a query on the Joomla Database. The first results column returned by the query provides the values for the drop down box.', '', 1, 3, '', '', 'd4c16f1e-fd6e-4714-90eb-f9d97edd9c32'),
-(22, 'The Tag field type provides a point where you can enter tags - this is either AJAX or nested.', 'Tag', '{\"properties0\":{\"name\":\"type\",\"example\":\"tag\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be tag.\"},\"properties1\":{\"name\":\"name\",\"example\":\"tags\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"mode\",\"example\":\"ajax\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the way the tags will be loaded, the options are ( ajax or nested )\"},\"properties3\":{\"name\":\"label\",\"example\":\"Tags\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Assign tags to ###VIEW### items. Tag names must be unique.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the description of the field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the id to add to the field. Note if none is set this will be the name of the field.\"},\"properties6\":{\"name\":\"class\",\"example\":\"inputbox small\",\"adjustable\":\"1\",\"description\":\"(optional) is the class to add to the field.\"},\"properties7\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) determines if non published tags should be allowed.\"},\"properties8\":{\"name\":\"language\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is language to filter the existing tags by.\"},\"properties9\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) is the ability to add more than 1 tag to the form field.\"},\"properties10\":{\"name\":\"custom\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) if the ajax mode is chosen setting this to [deny] will prevent users from adding in new tags.\"},\"properties11\":{\"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\"}}', 'provides an entry point for tags (either AJAX or Nested).', '', 1, 3, '', '', '48cba89e-8fcb-481e-a7d3-2e41773e452d'),
-(23, 'The tel field type is an alias for a text field. Telephone numbers can be validated using the tel rule and filtered using the tel input filter.', 'Tel', '{\"properties0\":{\"name\":\"type\",\"example\":\"text\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be text.\"},\"properties1\":{\"name\":\"name\",\"example\":\"phone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Phone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter phone number\",\"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.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"tel\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validated\",\"example\":\"tel\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to validated the input data.\"},\"properties13\":{\"name\":\"message\",\"example\":\"Error! Please add phone number here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties14\":{\"name\":\"hint\",\"example\":\"Your Phone Number\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties15\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties16\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides an input field for a telephone number.', '', 1, 6, '', '', '1c6c519c-3bc8-4914-8940-3e9591b0bce6'),
-(24, 'The text form field type provides a text box for data entry. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Text', '{\"properties0\":{\"name\":\"type\",\"example\":\"text\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be text.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextvalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"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\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties14\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties15\":{\"name\":\"hint\",\"example\":\"Your Name Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties16\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties18\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text box for data entry.', '', 1, 10, '', '', '201327fe-3067-4316-a155-3fe2a52e05c0'),
-(25, 'The textarea form field type provides a text area for entry of multi-line text. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Textarea', '{\"properties0\":{\"name\":\"type\",\"example\":\"textarea\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be textarea.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextarea\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"rows\",\"example\":\"10\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.\"},\"properties4\":{\"name\":\"cols\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"default text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Text Area\",\"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\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties8\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties9\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties10\":{\"name\":\"hint\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the textarea.\"},\"properties11\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties12\":{\"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\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties14\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties15\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties16\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text area for entry of multi-line text.', '', 1, 9, '', '', '76fe1250-6fa7-49e5-a0ee-f06d8d4c9f99'),
-(26, 'The timezones form field type provides a drop down list of time zones. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Timezone', '{\"properties0\":{\"name\":\"type\",\"example\":\"timezone\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be timezone.\"},\"properties1\":{\"name\":\"name\",\"example\":\"timezone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Timezone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default time zone. For example, use \'-10\' for \'(UTC -10:00) Hawaii\'.\"},\"properties4\":{\"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.\"},\"properties5\":{\"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\"}}', 'provides a drop down list of time zones.', '', 1, 3, '', '', 'ed8d8cf4-cb05-49cc-95ef-4ef275f539f9'),
-(27, 'This field essentially is a text field with the type of url. If a fully qualified url (that is one with a scheme and domain such as http://example.com) is entered and it uses idn (that is uses characters that are non ascii such as ê or Ψ) it will translat', 'URL', '{\"properties0\":{\"name\":\"type\",\"example\":\"url\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be url.\"},\"properties1\":{\"name\":\"name\",\"example\":\"website\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Website\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter website address\",\"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.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"relative\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) set to true for relative URLs\"},\"properties12\":{\"name\":\"filter\",\"example\":\"url\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties13\":{\"name\":\"validated\",\"example\":\"url\",\"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.\"},\"properties14\":{\"name\":\"scheme\",\"example\":\"http,https,mailto\",\"adjustable\":\"1\",\"description\":\"(optional) Validates that the value is a URL with a valid scheme (which can be restricted by the optional comma-separated field \'scheme\'), and passes a basic syntax check.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add website here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"Your Website Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties19\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties18\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a URL text input field.', '', 1, 10, '', '', '8df6e07e-2b16-43ed-a18d-2059fa44cdf1'),
-(28, 'The user form field type provides a modal select box of users.', 'User', '{\"properties0\":{\"name\":\"type\",\"example\":\"user\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be user.\"},\"properties1\":{\"name\":\"name\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"User\",\"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\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"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\"}}', 'provides a modal list of users.', '', 1, 4, '', '', 'b0641980-5e78-42f6-972f-86aa607db23e'),
-(29, 'The usergroup form field type provides a modal select box of user groups.', 'Usergrouplist', '{\"properties0\":{\"name\":\"type\",\"example\":\"usergrouplist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be usergrouplist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"usergroup\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Group\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select a group\",\"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\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"layout\",\"example\":\"joomla.form.field.list-fancy-select\",\"adjustable\":\"1\",\"description\":\"(optional) (translatable) is the layout, for example joomla.form.field.list-fancy-select.\"},\"properties6\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the field required true if yes.\"},\"properties8\":{\"name\":\"checksuperusergroup\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) is boolean to omit Super User groups. Values 1 or 0.\"},\"properties9\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties10\":{\"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\"}}', 'provides a drop down list of user groups.', '', 1, 7, '', '', 'e2f31181-fbb3-4c3a-859d-72b6b0cff308'),
-(30, 'The filelist form field type provides a drop down list of files from a specified directory. 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.\r\n\r\nBy default, the first item on the', 'Filelist', '{\"properties0\":{\"name\":\"type\",\"example\":\"filelist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be filelist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfile\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a file\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\\/stories\",\"adjustable\":\"1\",\"description\":\"(optional) is the filesystem path to the directory containing the files to be listed. If omitted the directory given by JPATH_ROOT is assumed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default file name.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of files selected for inclusion in the drop-down list. If omitted, all files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"stripext\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true then file name extensions will be stripped from the file names listed. Also note that the file name will be saved without the extension too.\"},\"properties9\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties10\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties11\":{\"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\"}}', 'Provides a drop down list of files from a specified directory.', '', 1, 4, '', 1, '0c80df15-52c6-4647-983b-4bb4888a2edf'),
-(31, 'The folderlist form field type provides a drop down list of folders from a specfied directory. 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.\r\n\r\nBy default, the first item on ', 'Folderlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"folderlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be folderlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfolder\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a folder\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the filesystem path to the directory containing the folders to be listed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default folder name.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of folders selected for inclusion in the drop-down list. If omitted, all folders in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude folders from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties9\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties10\":{\"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\"}}', 'Provides a drop down list of folders from a specified directory.', '', 1, 4, '', 2, 'd3ab2ae4-9370-4497-ae6d-dee2e0b74b7a'),
-(32, 'Note: When using the file input type you should always add the attribute enctype=\"multipart/form-data\" to your form tag. Otherwise, the uploaded files will not be attached correctly.\r\n\r\nNote 2: You can put a soft limit file size by adding a hidden field with name=\"MAX_FILE_SIZE\" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.', 'File', '{\"properties0\":{\"name\":\"type\",\"example\":\"file\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be file.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfilevalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Choose an image from your computer with maximum 100KB\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value, but doesn\'t mean much for a file.\"},\"properties5\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the file box in characters.\"},\"properties6\":{\"name\":\"accept\",\"example\":\"image\\/*\",\"adjustable\":\"1\",\"description\":\"(optional) Tells the browser what MIME types your form will allow to be uploaded.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"labelclass\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) adds a CSS class for form field\'s label; for Joomla 2.5.4+\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties11\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) For Joomla form validating it to be filled in\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Whether to Joomla validate the field according to rules\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides an input field for files', '', 1, 9, '', 3, '6da71c1e-119c-4e0d-a309-f3e52ecfa1d1'),
-(33, 'The menuitem form field type provides a drop down grouped list of the available menu items from your Joomla site.', 'menuitem', '{\"properties0\":{\"name\":\"type\",\"example\":\"menuitem\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be menuitem.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mymenuitem\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a menu item\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default menu item. Note that this is the ItemID number of the menu item.\"},\"properties4\":{\"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.\"},\"properties5\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) determines whether all menu items are listed or only published menu items. If state is \'0\' then all menu items will be listed. If state is \'1\' then only published menu items will be listed.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"int\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a drop down list of the available menu items from your Joomla site.', '', 1, 5, '', 4, 'f183b0e2-017f-48bd-8dba-d332ce1b8d9e'),
-(34, 'Remember all views already have [accesslevel] added by default, only add this if you need more custom access selection! Provides a dropdown list of accesslevel options with the current option selected.', 'Accesslevel', '{\"properties0\":{\"name\":\"type\",\"example\":\"accesslevel\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be accesslevel\"},\"properties1\":{\"name\":\"name\",\"example\":\"accesstwo\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute. \"},\"properties2\":{\"name\":\"label\",\"example\":\"Access Two\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select an access level to this concept.\",\"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\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the field required true if yes.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties7\":{\"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\"}}', 'List of accesslevels', '', 1, 4, '', 5, '913ed2ce-836c-48e8-97af-e482441f47df'),
-(35, 'Provides a form with rows of fields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Subform', '{\"properties0\":{\"name\":\"type\",\"example\":\"subform\",\"description\":\"(mandatory) must be subform.\"},\"properties1\":{\"name\":\"name\",\"example\":\"options\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Option List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"layout\",\"example\":\"joomla.form.field.subform.repeatable-table\",\"adjustable\":\"1\",\"description\":\"(mandatory) The layout for the repeatable table.\"},\"properties4\":{\"name\":\"component\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) To change the component where it should search for layout\"},\"properties5\":{\"name\":\"client\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Function to initialise the application clientFrontend: site or 0Backend: admin or 1\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The rows to be multiple.\"},\"properties7\":{\"name\":\"buttons\",\"example\":\"add,remove,move\",\"adjustable\":\"1\",\"description\":\"(optional) Which buttons to show if multiple mode is true.Options: add,remove,move\"},\"properties8\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties9\":{\"name\":\"formsource\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) you can add a path to a xml file containing the fields.\"},\"properties10\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties11\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties12\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties13\":{\"name\":\"max\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties14\":{\"name\":\"min\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The minimum number of rows of fields required\"},\"properties15\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties16\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 14, '', 6, '7139f2c8-a70a-46a6-bbe3-4eefe54ca515'),
-(36, 'Provides an input field for an email address.', 'Email', '{\"properties0\":{\"name\":\"type\",\"example\":\"email\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be email.\"},\"properties1\":{\"name\":\"name\",\"example\":\"email\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Email Address\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"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 \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"email\",\"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\":\"unique\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) Used in validation, to check if we should test for uniqueness, to insure that this email does not already belong to another user. Check line 99 in \\/libraries\\/src\\/Form\\/Rule\\/EmailRule.php\"},\"properties14\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"your@email.com\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties17\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties18\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties19\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Email form field type', '', 1, 7, '', 7, '35948af5-9e79-4454-8dfa-682ee4fdf650'),
-(37, 'Provides a dropdown list of plugin options from the folder.', 'Plugins', '{\"properties0\":{\"name\":\"type\",\"example\":\"plugins\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editors.\"},\"properties1\":{\"name\":\"name\",\"example\":\"editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"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 label.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"folder\",\"example\":\"editors\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) editors or captcha.\"},\"properties7\":{\"name\":\"filter\",\"example\":\"cmd\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties8\":{\"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\"}}', 'Provides a dropdown list of plugin options from the folder.', '', 1, 8, '', 8, '37fa4e1d-b7ca-4a8f-aa4b-d8085c135233'),
-(38, 'Provides the use of a captcha plugin.', 'Captcha', '{\"properties0\":{\"name\":\"type\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties3\":{\"name\":\"name\",\"example\":\"captcha\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"validate\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties1\":{\"name\":\"label\",\"example\":\"Captcha\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"We do not like spam, please show us you are human\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"namespace\",\"example\":\"componentbuilder\",\"description\":\"(optional) the component name seems to work\"}}', 'Captcha robot check.', '', 1, 2, '', 9, '206fdad4-14d0-45f1-9c84-3d09abf48a39'),
-(39, 'The list form field type provides a drop down list or a list box of custom-defined 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.', 'Groupedlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"groupedlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be groupedlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mygrouplist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"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\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"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\":\"option\",\"example\":\"Group Name@@1,1|Option 1|1,2|Option 2|1,Group Name 2@@2,3|Option 3|2\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties11\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties12\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 3, '', 10, '088d47c0-b058-4894-b92e-dcf1b9d5a722'),
-(40, 'The modulelayout form field type provides a drop down list of all available layouts for a module, grouped by core and template. 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.', 'Modulelayout', '{\"properties0\":{\"name\":\"type\",\"example\":\"modulelayout\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be modulelayout.\"},\"properties1\":{\"name\":\"name\",\"example\":\"layout\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Layout\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Module layout\",\"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\":\"module\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a specific module name (e.g. mod_articles_category).\"},\"properties5\":{\"name\":\"client_id\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional). If 0 (site): Forces searching for layouts only in directories \\/modules\\/[MODULENAME]\\/tmpl\\/ and all \\/templates\\/[TEMPLATENAME]\\/html\\/[MODULENAME]\\/. If 1 (administrator): Forces searching for layouts only in directories \\/administrator\\/modules\\/[MODULENAME]\\/tmpl\\/ and all \\/administrator\\/templates\\/[TEMPLATENAME]\\/html\\/[MODULENAME]\\/.\\r\\n\"},\"properties6\":{\"name\":\"template\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a template name (e.g. protostar or isis). If set forces searching for module template overrides only in this template.\"}}', 'modulelayout', '', 1, 2, '', 11, '7520c8f4-543d-4c7a-8e4f-e2da71c3b1cd'),
-(41, 'Joomla Privacy Field Type', 'Privacy@', '{\"properties0\":{\"name\":\"type\",\"example\":\"privacy\",\"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\":\"privacy\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Privacy Policy\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Read the full privacy policy.\",\"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\":\"filter\",\"example\":\"integer\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|I agree,0|No\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties7\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties10\":{\"name\":\"extends\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"Must be radio\"},\"properties11\":{\"name\":\"type_phpHEADER_1\",\"example\":\"use Joomla\\\\CMS\\\\Factory;\\r\\nuse Joomla\\\\CMS\\\\Language\\\\Text;\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The Header USE options\"},\"properties12\":{\"name\":\"type_php_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the field input markup.\\r\\n\\t *\\r\\n\\t * @return string The field input markup.\\r\\n\\t *\\r\\n\\t * @since 3.9.0\\r\\n\\t *\\/\\r\\n\\tprotected function getInput()\\r\\n\\t{\\r\\n\\t\\t\\/\\/ Display the message before the field\\r\\n\\t\\techo $this->getRenderer(\'plugins.system.privacyconsent.message\')->render($this->getLayoutData());\\r\\n\\r\\n\\t\\treturn parent::getInput();\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getInput method.\"},\"properties13\":{\"name\":\"type_phpa_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the field label markup.\\r\\n\\t *\\r\\n\\t * @return string The field label markup.\\r\\n\\t *\\r\\n\\t * @since 3.9.0\\r\\n\\t *\\/\\r\\n\\tprotected function getLabel()\\r\\n\\t{\\r\\n\\t\\tif ($this->hidden)\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn \'\';\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\treturn $this->getRenderer(\'plugins.system.privacyconsent.label\')->render($this->getLayoutData());\\r\\n\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLabel method.\"},\"properties14\":{\"name\":\"type_phpb_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the data to be passed to the layout for rendering.\\r\\n\\t *\\r\\n\\t * @return array\\r\\n\\t *\\r\\n\\t * @since 3.9.4\\r\\n\\t *\\/\\r\\n\\tprotected function getLayoutData()\\r\\n\\t{\\r\\n\\t\\t$data = parent::getLayoutData();\\r\\n\\r\\n\\t\\t$article = false;\\r\\n\\t\\t$privacyArticle = $this->element[\'article\'] > 0 ? (int) $this->element[\'article\'] : 0;\\r\\n\\r\\n\\t\\tif ($privacyArticle && Factory::getApplication()->isClient(\'site\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$db = Factory::getDbo();\\r\\n\\t\\t\\t$query = $db->getQuery(true)\\r\\n\\t\\t\\t\\t->select($db->quoteName(array(\'id\', \'alias\', \'catid\', \'language\')))\\r\\n\\t\\t\\t\\t->from($db->quoteName(\'#__content\'))\\r\\n\\t\\t\\t\\t->where($db->quoteName(\'id\') . \' = \' . (int) $privacyArticle);\\r\\n\\t\\t\\t$db->setQuery($query);\\r\\n\\t\\t\\t$article = $db->loadObject();\\r\\n\\r\\n\\t\\t\\tJLoader::register(\'ContentHelperRoute\', JPATH_BASE . \'\\/components\\/com_content\\/helpers\\/route.php\');\\r\\n\\r\\n\\t\\t\\t$slug = $article->alias ? ($article->id . \':\' . $article->alias) : $article->id;\\r\\n\\t\\t\\t$article->link = ContentHelperRoute::getArticleRoute($slug, $article->catid, $article->language);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$extraData = array(\\r\\n\\t\\t\\t\'privacynote\' => !empty($this->element[\'note\']) ? $this->element[\'note\'] : Text::_(\'By signing up to this web site and agreeing to the Privacy Policy you agree to this web site storing your information.\'),\\r\\n\\t\\t\\t\'options\' => $this->getOptions(),\\r\\n\\t\\t\\t\'value\' => (string) $this->value,\\r\\n\\t\\t\\t\'translateLabel\' => $this->translateLabel,\\r\\n\\t\\t\\t\'translateDescription\' => $this->translateDescription,\\r\\n\\t\\t\\t\'translateHint\' => $this->translateHint,\\r\\n\\t\\t\\t\'privacyArticle\' => $privacyArticle,\\r\\n\\t\\t\\t\'article\' => $article,\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\treturn array_merge($data, $extraData);\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLayoutData method.\"}}', 'Joomla Privacy Field', '', 1, 7, '', 12, '60c1d674-8bb7-4b31-97ed-ee1f16bc412a'),
-(42, 'Joomla Terms Field Type', 'Terms@', '{\"properties0\":{\"name\":\"type\",\"example\":\"terms\",\"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\":\"terms\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Terms & Conditions\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Read the full terms and conditions.\",\"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\":\"filter\",\"example\":\"integer\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|I agree,0|No\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties7\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties10\":{\"name\":\"extends\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"Must be radio\"},\"properties11\":{\"name\":\"type_phpHEADER_1\",\"example\":\"use Joomla\\\\CMS\\\\Factory;\\r\\nuse Joomla\\\\CMS\\\\Form\\\\FormHelper;\\r\\nuse Joomla\\\\CMS\\\\Language\\\\Associations;\\r\\nuse Joomla\\\\CMS\\\\Language\\\\Text;\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The Header USE options\"},\"properties12\":{\"name\":\"type_php_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the field input markup.\\r\\n\\t *\\r\\n\\t * @return string The field input markup.\\r\\n\\t *\\r\\n\\t * @since 3.9.0\\r\\n\\t *\\/\\r\\n\\tprotected function getInput()\\r\\n\\t{\\r\\n\\t\\t\\/\\/ Display the message before the field\\r\\n\\t\\techo $this->getRenderer(\'plugins.user.terms.message\')->render($this->getLayoutData());\\r\\n\\r\\n\\t\\treturn parent::getInput();\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getInput method.\"},\"properties13\":{\"name\":\"type_phpa_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the field label markup.\\r\\n\\t *\\r\\n\\t * @return string The field label markup.\\r\\n\\t *\\r\\n\\t * @since 3.9.0\\r\\n\\t *\\/\\r\\n\\tprotected function getLabel()\\r\\n\\t{\\r\\n\\t\\tif ($this->hidden)\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn \'\';\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\treturn $this->getRenderer(\'plugins.user.terms.label\')->render($this->getLayoutData());\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLabel method.\"},\"properties14\":{\"name\":\"type_phpb_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the data to be passed to the layout for rendering.\\r\\n\\t *\\r\\n\\t * @return array\\r\\n\\t *\\r\\n\\t * @since 3.9.4\\r\\n\\t *\\/\\r\\n\\tprotected function getLayoutData()\\r\\n\\t{\\r\\n\\t\\t$data = parent::getLayoutData();\\r\\n\\r\\n\\t\\t$article = false;\\r\\n\\t\\t$termsArticle = $this->element[\'article\'] > 0 ? (int) $this->element[\'article\'] : 0;\\r\\n\\r\\n\\t\\tif ($termsArticle && Factory::getApplication()->isClient(\'site\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$db = Factory::getDbo();\\r\\n\\t\\t\\t$query = $db->getQuery(true)\\r\\n\\t\\t\\t\\t->select($db->quoteName(array(\'id\', \'alias\', \'catid\', \'language\')))\\r\\n\\t\\t\\t\\t->from($db->quoteName(\'#__content\'))\\r\\n\\t\\t\\t\\t->where($db->quoteName(\'id\') . \' = \' . (int) $termsArticle);\\r\\n\\t\\t\\t$db->setQuery($query);\\r\\n\\t\\t\\t$article = $db->loadObject();\\r\\n\\r\\n\\t\\t\\tJLoader::register(\'ContentHelperRoute\', JPATH_BASE . \'\\/components\\/com_content\\/helpers\\/route.php\');\\r\\n\\r\\n\\t\\t\\tif (Associations::isEnabled())\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$termsAssociated = Associations::getAssociations(\'com_content\', \'#__content\', \'com_content.item\', $termsArticle);\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$currentLang = Factory::getLanguage()->getTag();\\r\\n\\r\\n\\t\\t\\tif (isset($termsAssociated) && $currentLang !== $article->language && array_key_exists($currentLang, $termsAssociated))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$article->link = ContentHelperRoute::getArticleRoute(\\r\\n\\t\\t\\t\\t\\t$termsAssociated[$currentLang]->id,\\r\\n\\t\\t\\t\\t\\t$termsAssociated[$currentLang]->catid,\\r\\n\\t\\t\\t\\t\\t$termsAssociated[$currentLang]->language\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$slug = $article->alias ? ($article->id . \':\' . $article->alias) : $article->id;\\r\\n\\t\\t\\t\\t$article->link = ContentHelperRoute::getArticleRoute($slug, $article->catid, $article->language);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$extraData = array(\\r\\n\\t\\t\\t\'termsnote\' => !empty($this->element[\'note\']) ? $this->element[\'note\'] : Text::_(\'By signing up to this web site you accept the Terms & Conditions.\'),\\r\\n\\t\\t\\t\'options\' => $this->getOptions(),\\r\\n\\t\\t\\t\'value\' => (string) $this->value,\\r\\n\\t\\t\\t\'translateLabel\' => $this->translateLabel,\\r\\n\\t\\t\\t\'translateDescription\' => $this->translateDescription,\\r\\n\\t\\t\\t\'translateHint\' => $this->translateHint,\\r\\n\\t\\t\\t\'termsArticle\' => $termsArticle,\\r\\n\\t\\t\\t\'article\' => $article,\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\treturn array_merge($data, $extraData);\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLayoutData method.\"}}', 'Joomla Terms Field', '', 1, 7, '', 12, '20e88943-08db-49e6-a571-dba70cdf4cca'),
-(43, 'Provides a combobox field, which offers a list like the List Form Field Type, but additionally allows free text.', 'Combo', '{\"properties0\":{\"name\":\"type\",\"example\":\"combo\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be combo.\"},\"properties1\":{\"name\":\"name\",\"example\":\"type\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Type\",\"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) tooltip for the form field.\"},\"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\":\"combobox\",\"adjustable\":\"1\",\"description\":\"(optional) specify your own classes for additonal markup, defaults to \\\"combobox\\\".\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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.\"},\"properties9\":{\"name\":\"option\",\"example\":\"0|Option 1,1|Option 2,2|Option 1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties10\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties12\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Provides a combobox list field, allows free text.', '', 1, 3, '', 13, '2c8b128f-7da2-4f55-b1d7-3613f902f590'),
-(44, 'The imagelist form field type provides a drop down list of image files in a specified directory. Only files with .png, .gif, .jpg, .bmp, .ico extensions are listed. 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.\r\n\r\nBy default, the first item on the list is \'- Do not use -\' (which is translatable) and is given the value \'-1\' and this is followed by \'- Use default -\' (also translatable) given the value \'0\'.', 'Imagelist', '{\"properties0\":{\"name\":\"type\",\"example\":\"imagelist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be imagelist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myimagelist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an image\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\\/stories\",\"adjustable\":\"1\",\"description\":\"(optional) is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default image file name.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of image files selected for inclusion in the drop-down list. If omitted, all image files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude image files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"stripext\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true then file name extensions will be stripped from the image file names listed. Also note that the file name will be saved without the extension too.\"},\"properties9\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties10\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties11\":{\"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\"}}', 'Provides a drop down list of image files from a specified directory.', '', 1, 3, '', 14, '72680e92-2859-49c6-ad92-c2329c52f9f8'),
-(45, '', 'Modal Menu', '{\"properties0\":{\"name\":\"type\",\"example\":\"modal_menu\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be modal_menu.\"},\"properties1\":{\"name\":\"name\",\"example\":\"base\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Base Item\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"option\",\"example\":\"Current\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties4\":{\"name\":\"select\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) show select options\"},\"properties5\":{\"name\":\"new\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties6\":{\"name\":\"edit\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties7\":{\"name\":\"description\",\"example\":\"Select a menu item to always be used as the base for the menu display. You must set the Start Level to the same level or higher than the level of the base item. This will cause the module to be displayed on all assigned pages. If Current is selected the active item is used as the base. This causes the module to only display when the parent menu item is active.\",\"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.\"},\"properties8\":{\"name\":\"clear\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties9\":{\"name\":\"disable\",\"example\":\"separator,alias,heading,url\",\"adjustable\":\"1\",\"description\":\"(optional)\"},\"properties10\":{\"name\":\"filter\",\"example\":\"integer\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of image files selected for inclusion in the drop-down list. If omitted, all image files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties11\":{\"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\\r\\n\"}}', 'Modal Menu', '', 1, 7, '', 15, '715256a4-8cc2-4d66-9d08-31e58ca5b036'),
-(46, 'The menu form field type provides a drop down list of the available menus from your Joomla! site. 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. ', 'Menu', '{\"properties0\":{\"name\":\"type\",\"example\":\"menu\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be menu.\"},\"properties1\":{\"name\":\"name\",\"example\":\"menutype\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the filed.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Menu to Show\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Choose which menu should be rendered with this instance of module.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties4\":{\"name\":\"clientid\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default menu. Note that this is the name of the menu shown in the Type column on the Menu Manager screen and not the menu ID number.\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties7\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Menu Type', '', 1, 4, '', 16, '6349f152-8ef5-43bd-a89b-ce18f33ac5e5'),
-(47, 'Dynamic Checkboxes', 'DynamicCheckboxes@', '{\"properties0\":{\"name\":\"type\",\"example\":\"change_this\",\"adjustable\":\"1\",\"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\":\"dynamic_checkboxes\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Dynamic Checkboxes\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"The checkbox linked to global subform of the same name\",\"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\":\"option\",\"example\":\"1|Default\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this checkboxes. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties5\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"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\"},\"properties8\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties9\":{\"name\":\"extends\",\"example\":\"checkboxes\",\"mandatory\":\"1\",\"description\":\"Must be checkboxes\"},\"properties10\":{\"name\":\"type_phpHEADER_1\",\"example\":\"\\\\JFormHelper::loadFieldClass(\'checkboxes\');\\r\\nuse VDM\\\\Joomla\\\\Utilities\\\\Component\\\\Helper;\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The Header USE options\"},\"properties11\":{\"name\":\"type_php_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the data to be passed to the layout for rendering.\\r\\n\\t *\\r\\n\\t * @return array\\r\\n\\t *\\r\\n\\t * @since 3.5\\r\\n\\t *\\/\\r\\n\\tprotected function getLayoutData()\\r\\n\\t{\\r\\n\\t\\t$data = parent::getLayoutData();\\r\\n\\r\\n\\t\\t\\/\\/ True if the field has \'value\' set. In other words, it has been stored, don\'t use the default values.\\r\\n\\t\\t$hasValue = (isset($this->value) && !empty($this->value));\\r\\n\\r\\n\\t\\t\\/\\/ If a value has been stored, use it. Otherwise, use the defaults.\\r\\n\\t\\t$checkedOptions = $hasValue ? $this->value : $this->checkedOptions;\\r\\n\\r\\n\\t\\t\\/\\/ get the form options\\r\\n\\t\\t$options = $this->getOptions();\\r\\n\\r\\n\\t\\t\\/\\/ get the component params\\r\\n\\t\\t$params = Helper::getParams();\\r\\n\\t\\t$subform = $params->get($this->fieldname);\\r\\n\\r\\n\\t\\t\\/\\/ add the paths found in global settings\\r\\n\\t\\tif (is_array($subform) && $subform !== [])\\r\\n\\t\\t{\\r\\n\\t\\t\\tforeach ($subform as $value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tif (isset($value->path) && strlen($value->path) > 3)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$tmp = new \\\\stdClass;\\r\\n\\t\\t\\t\\t\\t$tmp->value = $value->set_me;\\r\\n\\t\\t\\t\\t\\t$tmp->text = $value->set_me;\\r\\n\\t\\t\\t\\t\\t$tmp->checked = false;\\r\\n\\r\\n\\t\\t\\t\\t\\t$options[] = $tmp;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$extraData = array(\\r\\n\\t\\t\\t\'checkedOptions\' => is_array($checkedOptions) ? $checkedOptions : explode(\',\', (string) $checkedOptions),\\r\\n\\t\\t\\t\'hasValue\' => $hasValue,\\r\\n\\t\\t\\t\'options\' => $options\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\treturn array_merge($data, $extraData);\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLayoutData method.\"}}', 'Super Power Repository Paths', '', 1, 14, '', 12, '7ed21e79-cbc5-48e3-9ed0-ca72b0f2f1a1');
+(1, 'The calendar form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box.', 'Calendar', '{\"properties0\":{\"name\":\"type\",\"example\":\"calendar\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be calendar.\"},\"properties1\":{\"name\":\"name\",\"example\":\"date\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a date\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"NOW\",\"adjustable\":\"1\",\"description\":\"(optional) is the default date. This must be given in the same format as specified by the format argument. You can put \\\"NOW\\\" to have current time.\"},\"properties4\":{\"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 text box.\"},\"properties5\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether the text box is read-only (true or false). If the text box is read-only, the date cannot be changed, but can be selected and copied. No calendar icon will be shown.\"},\"properties6\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether the text box is disabled (true or false). If the text box is disabled, the date cannot be changed, selected or copied.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"format\",\"example\":\"%d-%m-%Y\",\"adjustable\":\"1\",\"description\":\"(optional) is the date format to be used. This is in the format used by PHP to specify date string formats (see below). If no format argument is given, \'%Y-%m-%d\' is assumed (giving dates like \'2008-04-16\').\"},\"properties9\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is time zone to be used. There are two values; server_utc and user_utc. The first one is server time zone and the later is user time zone as configured in global configuration and user information respectively.\"},\"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.\"},\"properties11\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties12\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional)\"},\"properties13\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties14\":{\"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\"},\"properties15\":{\"name\":\"translateformat\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): If set to true, the calendar will use a language string to determine the format. The `format` attribute is ignored. If false, the `format` attribute is used (same behaviour as today). (starting with 3.7.0)\"},\"properties16\":{\"name\":\"showtime\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): If set to true and translateformat is true, the language key DATE_FORMAT_CALENDAR_DATETIME is used, otherwise DATE_FORMAT_CALENDAR_DATE. (starting with 3.7.0)\"},\"properties17\":{\"name\":\"timeformat\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): can be set to 12 (and specify AM or PM) or 24 (starting with 3.7.0)\"},\"properties18\":{\"name\":\"singleheader\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to false, the year and the month selection will be set on two separates lines, with independant selection (starting with 3.7.0)\"},\"properties19\":{\"name\":\"todaybutton\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, a button is added at the bottom of the datePicker to select the date of the current day (starting with 3.7.0)\"},\"properties20\":{\"name\":\"weeknumbers\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, a column is added at the left of the datePicker to display the number of the week in the current year (starting with 3.7.0)\"},\"properties21\":{\"name\":\"filltable\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, dates of the previous and next month is added at the top and the bottom of the current month to fill the grid (starting with 3.7.0)\"},\"properties22\":{\"name\":\"minyear\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user could not select a year before your limit (starting with 3.7.0)\"},\"properties23\":{\"name\":\"maxyear\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user could not select a year after your limit (starting with 3.7.0)\"}}', 'Text box for entry of a date.', '{\"source\":{\"618e8916-4028-4d5b-b85c-970304685913-settings\":\"6ae1ea0dac5b29ee5cb356c6f17fe14562366587\",\"618e8916-4028-4d5b-b85c-970304685913-readme\":\"c9eeddeadaced241e8e7289a1c7ac591d731043f\"}}', 1, 13, 0, 0, '6cf5a33f-cb25-4a58-bfec-7e1511896402'),
+(2, 'The category form field type provides a drop down list of all published categories for a certain extension. 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.', 'Category', '{\"properties0\":{\"name\":\"type\",\"example\":\"category\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be category.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mycategory\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a category\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"extension\",\"example\":\"com_content\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the name of the extension for which the categories will be retrieved. For example, to list content categories, use the value \'com_content\'. You can add also target one view, use the value \'com_component.view\'.\"},\"properties4\":{\"name\":\"scope\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is an alias for extension.\"},\"properties5\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"show_root\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) is whether a choice representing the root category will be shown. Remove completely if it is not to be shown.\"},\"properties7\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default category ID number.\"},\"properties8\":{\"name\":\"description\",\"example\":\"select one of the following categories\",\"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.\"},\"properties9\":{\"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\'.\"},\"properties10\":{\"name\":\"published\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) (1\\/0\\/2\\/-2) is whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories. It is possible to combine different publishing status by entering the list of the corresponding numbers separated by comma (e.g. \\\"0,2,-2\\\" will display only unpublished, archived and trashed categories in the drop-down).\"},\"properties11\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"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\"}}', 'Drop down list of categories.', '', 1, 15, 0, 0, 'f70346b3-2096-4f44-8b26-01ab87da7d1e'),
+(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. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (JavaScript use)\"}}', 'A single checkbox.', '', 1, 10, 0, 0, '10066262-b6e3-4f82-941e-cbe4f61ddd6c'),
+(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 an array.', 'Checkboxes', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkboxes\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkboxs\"},\"properties1\":{\"name\":\"name\",\"example\":\"toppings\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select Toppings\",\"adjustable\":\"1\",\"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\",\"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\",\"description\":\"(optional) is the default value.\"},\"properties5\":{\"name\":\"description\",\"example\":\"Select the topping of your choice\",\"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.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"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. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Checkboxes that can be used for multi-select.', '', 1, 5, 0, 0, 'ac10859b-58da-4584-9682-36a6c2c8d04d'),
+(5, 'Provides a color picker input that allows users to select a color from a visual palette or enter a hexadecimal color code, such as #ff00ff.', 'Color', '{\"properties0\":{\"name\":\"type\",\"example\":\"color\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be color.\"},\"properties1\":{\"name\":\"name\",\"example\":\"backgroundcolor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"default\",\"example\":\"#FFFFFF\",\"adjustable\":\"1\",\"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\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"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\"}}', 'Color picker when clicking the input box.', '', 1, 6, 0, 0, '7f60f198-53e7-4fe9-813f-d1b6c553680e'),
+(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. 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\'.\"},\"properties6\":{\"name\":\"layout\",\"example\":\"joomla.form.field.list-fancy-select\",\"adjustable\":\"1\",\"description\":\"(optional) New layout field added in Joomla 4\"},\"properties7\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties8\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties9\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"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.\"},\"properties11\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"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\"},\"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\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties15\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties16\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"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.\"},\"properties18\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties19\":{\"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.\"},\"properties20\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties21\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties22\":{\"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.\"},\"properties23\":{\"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.\"},\"properties24\":{\"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\"},\"properties25\":{\"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.\"}}', 'Custom drop down list of items entries.', '', 1, 35, 0, 0, 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a'),
+(7, 'A CustomUser fieldtype displays a filtered list of users based on selected user groups. It can exclude users already linked to items in the current view, making it useful for assigning unique users within specific contexts.', 'CustomUser', '{\"properties0\":{\"name\":\"type\",\"example\":\"staffusers\",\"mandatory\":\"1\",\"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\",\"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\",\"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\",\"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\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"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\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"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\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"mandatory\":\"1\",\"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\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"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.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\t\\t\\/\\/ set the groups array\\r\\n\\t\\treturn ComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties20\":{\"name\":\"type_phpx_1\",\"example\":\"\\t\\t\\/\\/ To ensure that there is only one record per user\\r\\n\\t\\t\\/\\/ Get a db connection.\\r\\n\\t\\t$db = Factory::getDbo();\\r\\n\\t\\t\\/\\/ Create a new query object.\\r\\n\\t\\t$query = $db->getQuery(true);\\r\\n\\t\\t\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\\r\\n\\t\\t$query->select($db->quoteName(\'###CODE###\'));\\r\\n\\t\\t$query->from($db->quoteName(\'#__###component###_###view###\'));\\r\\n\\t\\t$db->setQuery($query);\\r\\n\\t\\t$db->execute();\\r\\n\\t\\t$found = $db->getNumRows();\\r\\n\\t\\tif ($found)\\r\\n\\t\\t{\\r\\n\\t\\t\\t\\/\\/ return all users already used\\r\\n\\t\\t\\treturn array_unique($db->loadColumn());\\r\\n\\t\\t}\\r\\n\\t\\treturn null;\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"}}', 'List of users.', '', 1, 7, 0, 0, 'a4a39f70-070f-459c-be4b-0ac103a29b9a'),
+(8, 'The Editor field type provides a WYSIWYG (What You See Is What You Get) editor for rich text input, allowing users to format content visually without writing HTML.', '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.\"},\"properties4\":{\"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 label.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties7\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties8\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties9\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties10\":{\"name\":\"buttons\",\"example\":\"no\",\"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.\"},\"properties11\":{\"name\":\"syntax\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) can be used to set the code syntax matching for this field.\"},\"properties12\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties13\":{\"name\":\"editor\",\"example\":\"codemirror|none\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties14\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties15\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties16\":{\"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.\"},\"properties17\":{\"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\"}}', 'Editor area field.', '', 1, 13, 0, 0, '51f288d2-6eaa-42bc-a182-a6f69b3032b8'),
+(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; otherwise, the default value (if defined) will be used.', '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.\"},\"properties3\":{\"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.\"}}', 'Hidden field for storing fixed values.', '', 1, 3, 0, 0, '82f1b5ca-bb9b-44d7-9a7a-9a03fb2a31dd'),
+(10, 'The integer form field type provides a select box with a range of integer values. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Integer', '{\"properties0\":{\"name\":\"type\",\"example\":\"integer\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be integer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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.\"},\"properties9\":{\"name\":\"first\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties10\":{\"name\":\"last\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties11\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"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)\"}}', 'Dropdown of integers in a set range.', '', 1, 7, 0, 0, 'fdbb50ea-35d2-45b2-a0bc-076fdf1544b8'),
+(11, 'The list form field type provides a drop down list or a list box of custom-defined 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.', 'List', '{\"properties0\":{\"name\":\"type\",\"example\":\"list\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be list.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mylist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"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\":\"layout\",\"example\":\"joomla.form.field.list-fancy-select\",\"adjustable\":\"1\",\"description\":\"(optional) New layout field added in Joomla 4\"},\"properties7\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties8\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties9\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"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.\"},\"properties11\":{\"name\":\"option\",\"example\":\"0|Option 1,1|Option 2,2|Option 1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties12\":{\"name\":\"useglobal\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties13\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties14\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties15\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Dropdown list of a custom-defined entries.', '', 1, 14, 0, 0, 'a51dfc06-1b9b-4d0a-86ba-f705bcd40d4d'),
+(12, 'The media form field type provides modal access to the media manager for the choice of an image or other kind of media, e.g. video. Users with appropriate permissions will be able to upload files.', 'Media', '{\"properties0\":{\"name\":\"type\",\"example\":\"media\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be media.\"},\"properties1\":{\"name\":\"name\",\"example\":\"media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Media\",\"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\":\"directory\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the directory from which the user will be able to choose a file. This attribute should be relative to the top level \\/images\\/ folder. The default is that the user will be confined to the top level \\/images\\/ folder.\"},\"properties5\":{\"name\":\"preview\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) shows or hides the preview of the currently chosen image. (\\\"true\\\": Show always, \\\"tooltip\\\": Show as tooltip, \\\"false\\\": Show never). Default is \\\"tooltip\\\".\"},\"properties6\":{\"name\":\"preview_width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) sets the max-width of preview image (default: \\\"200\\\")\"},\"properties7\":{\"name\":\"preview_height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) sets the max-height of preview image (default: \\\"200\\\")\"},\"properties8\":{\"name\":\"types\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a comma-separated list of file types (images, audios, videos, documents, directories). Default is images. This list decides which of the allowed file extensions from Media Manager configuration are used. For example, images,documents means only files with an allowed images extension or an allowed documents extension are available for selection. When the type directories is used then the field will allow selection of a directory; this can be useful in setting extension parameters, to define an upload destination for example.\"},\"properties9\":{\"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\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Select or upload media via modal.', '', 1, 9, 0, 0, '69957007-e3d4-4976-a32b-611d02dbad71'),
+(13, 'The Meter form field type displays a visual indicator representing a numeric value within a specified range. It is useful for showing progress, performance, or any measurable quantity with optional thresholds for low, high, and optimum values.', 'Meter', '{\"properties0\":{\"name\":\"type\",\"example\":\"meter\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be meter.\"},\"properties1\":{\"name\":\"name\",\"example\":\"meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"width\",\"example\":\"330px\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of meter box\"},\"properties4\":{\"name\":\"color\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The background color\"},\"properties5\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"animated\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) lets the bar have strips\"},\"properties7\":{\"name\":\"active\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) lets the strips on the bar move\"},\"properties8\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"properties9\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties10\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties11\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties12\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"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\"}}', 'Displays a value within a defined range.', '', 1, 4, 0, 0, '81668284-e572-4e17-927b-ba697fc64bd0'),
+(14, 'This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without having to rely on the tooltips). Or adding any other text you want.', 'Note', '{\"properties0\":{\"name\":\"type\",\"example\":\"note\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be note\"},\"properties1\":{\"name\":\"name\",\"example\":\"note_one\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory or optional if using description) (translatable) is the descriptive title of the note \"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional if using label)(translatable) the description\\/text of the note \"},\"properties4\":{\"name\":\"heading\",\"example\":\"h4\",\"adjustable\":\"1\",\"description\":\"(optional) the type of heading element to use for the label (default: h4)\"},\"properties5\":{\"name\":\"class\",\"example\":\"alert\",\"adjustable\":\"1\",\"description\":\"(optional) a class name (or class names), like these examples ( alert, alert alert-info, alert alert-success, alert alert-error )\"},\"properties6\":{\"name\":\"close\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) a value of \'true\' (for alerts) or the value for the data-dismiss of the bootstrap close icon\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Displays custom text or headings in forms.', '', 1, 6, 0, 0, 'f9ecacd0-8481-4157-8c71-d7aaefc2b7c3'),
+(15, 'The number form field type provides a single-line input for numeric values, typically displayed with up/down step controls (spinner). It supports attributes such as minimum, maximum, and step values, allowing you to define numeric ranges and precision for user input.', 'Number', '{\"properties0\":{\"name\":\"type\",\"example\":\"number\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be number.\"},\"properties1\":{\"name\":\"name\",\"example\":\"number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"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.\"},\"properties5\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties8\":{\"name\":\"max\",\"example\":\"40\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties9\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this number, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Javascript that should run on changing of the value.\"},\"properties11\":{\"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\"}}', 'Single-line number input with step controls.', '', 1, 6, 0, 0, '5abd2b73-643b-4273-841a-787991aad968'),
+(16, 'The password form field type provides a text box for entry of a password. The password characters will be obscured as they are entered. If the field has a saved value this is entered (in obscured form) into the text box. If not, the default value (if any)', 'Password', '{\"properties0\":{\"name\":\"type\",\"example\":\"password\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be password.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mypassword\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter A Password\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"default\",\"example\":\"secret\",\"adjustable\":\"1\",\"description\":\"(optional) is the default password.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"message\",\"example\":\"Error! Please add password here.\",\"adjustable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"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.\"},\"properties12\":{\"name\":\"rules\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) determines whether the password should adhere to certain rules.\"},\"properties13\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties14\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties15\":{\"name\":\"hint\",\"example\":\"Password Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties16\":{\"name\":\"autocomplete\",\"example\":\"off\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties17\":{\"name\":\"strengthmeter\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) measures the strength of the password.\"},\"properties18\":{\"name\":\"force\",\"example\":\"off\",\"adjustable\":\"1\",\"description\":\"(optional) forces a password to be set.\"},\"properties19\":{\"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\"},\"properties20\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Text box for entry of a password.', '', 1, 12, 0, 0, '0022598d-0ee1-44f2-aa94-c2eb47595f73'),
+(17, 'The radio form field type displays a set of radio buttons for selecting one option from a predefined list. If the field has a saved value, that option is selected when the page loads; otherwise, the default value (if any) is used.', 'Radio', '{\"properties0\":{\"name\":\"type\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be radio.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myradiovalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"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\":\"class\",\"example\":\"btn-group btn-group-yesno\",\"adjustable\":\"1\",\"description\":\"(optional) New in Joomla 3, if set to class=\\\"btn-group btn-group-yesno\\\" will show the nice coloured buttons\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|Yes,0|No\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default radio button item value.\"},\"properties7\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"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\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"false\",\"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) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Radio buttons for option selection.', '', 1, 19, 0, 0, 'b868ed59-4208-4206-8504-95a35a74a11c'),
+(18, 'The Range form field type displays a horizontal slider that allows users to select a numeric value within a defined range. It supports attributes such as minimum, maximum, and step values to control the slider’s behavior and precision. This field offers a user-friendly alternative to numeric input fields when selecting values from a fixed interval.', 'Range', '{\"properties0\":{\"name\":\"type\",\"example\":\"range\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be range.\"},\"properties1\":{\"name\":\"name\",\"example\":\"range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties8\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties9\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"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.\"},\"properties12\":{\"name\":\"onchange\",\"example\":\"jQuery(\'#jform_range\').closest(\'.controls\').find(\'span\').remove(); var value = jQuery(\'#jform_range\').val();jQuery(\'#jform_range\').closest(\'.controls\').append(\' \'+value+\'\');\",\"adjustable\":\"1\",\"description\":\"(optional) javascript to run when the range is changed\"},\"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\"}}', 'Slider to select a value within a range.', '', 1, 7, 0, 0, '627d3845-7273-4f75-8e63-7b3a319a42c8'),
+(19, 'Provides a modal interface containing rows of form fields that you define. Users can add as many entries as needed, with each row repeating the specified field set. This field type relies on a jQuery-based JavaScript file for its dynamic functionality.', 'Repeatable', '{\"properties0\":{\"name\":\"type\",\"example\":\"repeatable\",\"adjustable\":\"1\",\"description\":\"(mandatory) must be repeatable.\"},\"properties1\":{\"name\":\"name\",\"example\":\"repeatable_list\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Repeatable List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"aid\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) id of the hidden from field. (the modal will have this id with an added suffix of \\\"_modal\\\" and the table within the modal will have this id with a suffix of _modal_table\\\")\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) class of the table.\"},\"properties7\":{\"name\":\"select\",\"example\":\"Click here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) The text to show on the modal button.\"},\"properties8\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties9\":{\"name\":\"maximum\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties10\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Form fields with repeatable rows of inputs.', '', 1, 7, 0, 0, '05bf68d4-52f9-4705-8ae7-cba137fce0ad'),
+(20, 'The spacer form field type provides a visual separator between groups of form fields. It serves purely as a visual aid to organize the layout of the form and does not store any value.', 'Spacer', '{\"properties0\":{\"name\":\"type\",\"example\":\"spacer\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be spacer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myspacer\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the text to use as a spacer.\"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"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\":\"hr\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether to display a horizontal rule (\'true\' or \'false\'). If this attribute is \'true\', the label attribute will be ignored.\"},\"properties5\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"}}', 'Visual divider with no stored value.', '', 1, 2, 0, 0, '626d0cba-a908-4a4f-a447-96d781aeaa0b'),
+(21, 'Using this generic form field type forces you to write SQL in an XML file and is rather limited. For more flexibility, consider using a Custom FieldType.\r\n\r\nThe sql form field type provides a drop down list of entries obtained by running a query on the Joomla database. The first column returned by the query is used as the option value, and the second column (if present) is used as the label displayed in the dropdown.', 'SQL', '{\"properties0\":{\"name\":\"type\",\"example\":\"sql\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be sql.\"},\"properties1\":{\"name\":\"name\",\"example\":\"title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an article\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"query\",\"example\":\"SELECT id, concat( title, \' (\', created, \')\') AS title FROM #__content\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the SQL query which will provide the data for the drop-down list. The query must return two columns; one called \'value\' (unless overridden by the key_field attribute) which will hold the values of the list items; the other called the same as the value of the name attribute (unless overridden by the value_field attribute) containing the text to be shown in the drop-down list.\"},\"properties4\":{\"name\":\"default\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value. This is the value of the \'value\' field, unless overridden by the key_field attribute.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties7\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties8\":{\"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.\"},\"properties9\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"description\":\"(optional) is the name of the column that will contain values for the parameter. If omitted then the column called \'value\' will be used, if it exists.\"},\"properties10\":{\"name\":\"value_field\",\"example\":\"title\",\"adjustable\":\"1\",\"description\":\"(optional) is the name of the column that will contain values to be shown to the user in the drop-down list. If omitted then the column with the same name as the name attribute will be used, if it exists.\"},\"properties11\":{\"name\":\"translate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) will translate the output of the value_field if set to true. It defaults to false.\"},\"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\"}}', 'Dropdown list populated by a database query.', '', 1, 4, 0, 0, 'd4c16f1e-fd6e-4714-90eb-f9d97edd9c32'),
+(22, 'The tag field type provides an input for assigning tags to an item. Tags can be selected or created using an AJAX-powered interface or chosen from a nested list of existing tags, depending on configuration. This allows for flexible and consistent tagging within Joomla.', 'Tag', '{\"properties0\":{\"name\":\"type\",\"example\":\"tag\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be tag.\"},\"properties1\":{\"name\":\"name\",\"example\":\"tags\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"mode\",\"example\":\"ajax\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the way the tags will be loaded, the options are ( ajax or nested )\"},\"properties3\":{\"name\":\"label\",\"example\":\"Tags\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Assign tags to ###VIEW### items. Tag names must be unique.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the description of the field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the id to add to the field. Note if none is set this will be the name of the field.\"},\"properties6\":{\"name\":\"class\",\"example\":\"inputbox small\",\"adjustable\":\"1\",\"description\":\"(optional) is the class to add to the field.\"},\"properties7\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) determines if non published tags should be allowed.\"},\"properties8\":{\"name\":\"language\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is language to filter the existing tags by.\"},\"properties9\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) is the ability to add more than 1 tag to the form field.\"},\"properties10\":{\"name\":\"custom\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) if the ajax mode is chosen setting this to [deny] will prevent users from adding in new tags.\"},\"properties11\":{\"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\"}}', 'Entry point for tags (either AJAX or Nested).', '', 1, 4, 0, 0, '48cba89e-8fcb-481e-a7d3-2e41773e452d'),
+(23, 'The tel field type is a text input specifically intended for telephone numbers. It functions as an alias of the standard text field but can be enhanced with the tel validation rule and input filter to ensure proper formatting and sanitation of phone number inputs.', 'Tel', '{\"properties0\":{\"name\":\"type\",\"example\":\"text\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be text.\"},\"properties1\":{\"name\":\"name\",\"example\":\"phone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Phone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter phone number\",\"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.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"tel\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validated\",\"example\":\"tel\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to validated the input data.\"},\"properties13\":{\"name\":\"message\",\"example\":\"Error! Please add phone number here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties14\":{\"name\":\"hint\",\"example\":\"Your Phone Number\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties15\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties16\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Input field for telephone numbers.', '', 1, 7, 0, 0, '1c6c519c-3bc8-4914-8940-3e9591b0bce6'),
+(24, 'The text form field type provides a single-line input box for entering textual data. If a saved value exists, it is displayed when the page loads; otherwise, the default value (if specified) is used. This field is commonly used for short, free-form text entries such as names, titles, or labels.', 'Text', '{\"properties0\":{\"name\":\"type\",\"example\":\"text\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be text.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextvalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"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\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties14\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties15\":{\"name\":\"hint\",\"example\":\"Your Name Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties16\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties18\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Single-line text input field.', '', 1, 11, 0, 0, '201327fe-3067-4316-a155-3fe2a52e05c0'),
+(25, 'The textarea form field type provides a multi-line input area for entering larger blocks of text. If a saved value exists, it is displayed when the page first loads; otherwise, the default value (if specified) is used. This field is ideal for content such as descriptions, comments, or notes.', 'Textarea', '{\"properties0\":{\"name\":\"type\",\"example\":\"textarea\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be textarea.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextarea\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"rows\",\"example\":\"10\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.\"},\"properties4\":{\"name\":\"cols\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"default text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Text Area\",\"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\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties8\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties9\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties10\":{\"name\":\"hint\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the textarea.\"},\"properties11\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties12\":{\"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\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties14\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties15\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties16\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Multi-line text input area.', '', 1, 10, 0, 0, '76fe1250-6fa7-49e5-a0ee-f06d8d4c9f99'),
+(26, 'The timezone form field type provides a dropdown list of available time zones for selection. If a saved value exists, it is displayed when the page is first loaded; otherwise, the default value (if specified) is shown. This field is useful for allowing users to set or adjust time zone preferences.', 'Timezone', '{\"properties0\":{\"name\":\"type\",\"example\":\"timezone\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be timezone.\"},\"properties1\":{\"name\":\"name\",\"example\":\"timezone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Timezone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default time zone. For example, use \'-10\' for \'(UTC -10:00) Hawaii\'.\"},\"properties4\":{\"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.\"},\"properties5\":{\"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\"}}', 'Dropdown list of time zones.', '', 1, 5, 0, 0, 'ed8d8cf4-cb05-49cc-95ef-4ef275f539f9'),
+(27, 'The URL field type is a text input specifically intended for entering web addresses. It functions like a standard text field but uses the url input type to enable browser-level validation. If a fully qualified URL (one with a scheme and domain, such as http://example.com) includes internationalized domain names (IDNs) with non-ASCII characters (e.g., ê or Ψ), it will be automatically converted to a valid ASCII-compatible format (Punycode) for proper handling and storage.', 'URL', '{\"properties0\":{\"name\":\"type\",\"example\":\"url\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be url.\"},\"properties1\":{\"name\":\"name\",\"example\":\"website\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Website\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter website address\",\"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.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"relative\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) set to true for relative URLs\"},\"properties12\":{\"name\":\"filter\",\"example\":\"url\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties13\":{\"name\":\"validated\",\"example\":\"url\",\"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.\"},\"properties14\":{\"name\":\"scheme\",\"example\":\"http,https,mailto\",\"adjustable\":\"1\",\"description\":\"(optional) Validates that the value is a URL with a valid scheme (which can be restricted by the optional comma-separated field \'scheme\'), and passes a basic syntax check.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add website here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"Your Website Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties17\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties18\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties19\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Text input for a valid URL.', '', 1, 11, 0, 0, '8df6e07e-2b16-43ed-a18d-2059fa44cdf1'),
+(28, 'The user form field type provides a modal-based selection interface for choosing a Joomla user. It allows administrators to browse and select users from the system through a searchable pop-up dialog.', 'User', '{\"properties0\":{\"name\":\"type\",\"example\":\"user\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be user.\"},\"properties1\":{\"name\":\"name\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"User\",\"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\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"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\"}}', 'Modal selector for Joomla users.', '', 1, 5, 0, 0, 'b0641980-5e78-42f6-972f-86aa607db23e'),
+(29, 'The usergrouplist form field type provides a dropdown list of all available Joomla user groups. It allows selection of a single group from the site\'s access control system for use in configuration or assignment settings.', 'Usergrouplist', '{\"properties0\":{\"name\":\"type\",\"example\":\"usergrouplist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be usergrouplist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"usergroup\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Group\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select a group\",\"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\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"layout\",\"example\":\"joomla.form.field.list-fancy-select\",\"adjustable\":\"1\",\"description\":\"(optional) (translatable) is the layout, for example joomla.form.field.list-fancy-select.\"},\"properties6\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the field required true if yes.\"},\"properties8\":{\"name\":\"checksuperusergroup\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) is boolean to omit Super User groups. Values 1 or 0.\"},\"properties9\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties10\":{\"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\"}}', 'Dropdown list of Joomla user groups.', '', 1, 8, 0, 0, 'e2f31181-fbb3-4c3a-859d-72b6b0cff308'),
+(30, 'The Filelist form field type provides a drop down list of files from a specified directory. 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.', 'Filelist', '{\"properties0\":{\"name\":\"type\",\"example\":\"filelist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be filelist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfile\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a file\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\\/stories\",\"adjustable\":\"1\",\"description\":\"(optional) is the filesystem path to the directory containing the files to be listed. If omitted the directory given by JPATH_ROOT is assumed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default file name.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of files selected for inclusion in the drop-down list. If omitted, all files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"stripext\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true then file name extensions will be stripped from the file names listed. Also note that the file name will be saved without the extension too.\"},\"properties9\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties10\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties11\":{\"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\"}}', 'File dropdown from directory.', '', 1, 7, 0, 1, '0c80df15-52c6-4647-983b-4bb4888a2edf'),
+(31, 'The Folderlist form field type provides a drop down list of folders from a specified directory. 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.', 'Folderlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"folderlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be folderlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfolder\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a folder\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the filesystem path to the directory containing the folders to be listed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default folder name.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of folders selected for inclusion in the drop-down list. If omitted, all folders in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude folders from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties9\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties10\":{\"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\"}}', 'Folder dropdown from directory.', '', 1, 6, 0, 2, 'd3ab2ae4-9370-4497-ae6d-dee2e0b74b7a'),
+(32, 'Note: When using the file input type you should always add the attribute enctype=\"multipart/form-data\" to your form tag. Otherwise, the uploaded files will not be attached correctly.\r\n\r\nNote 2: You can put a soft limit file size by adding a hidden field with name=\"MAX_FILE_SIZE\" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.', 'File', '{\"properties0\":{\"name\":\"type\",\"example\":\"file\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be file.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfilevalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Choose an image from your computer with maximum 100KB\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value, but doesn\'t mean much for a file.\"},\"properties5\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the file box in characters.\"},\"properties6\":{\"name\":\"accept\",\"example\":\"image\\/*\",\"adjustable\":\"1\",\"description\":\"(optional) Tells the browser what MIME types your form will allow to be uploaded.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"labelclass\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) adds a CSS class for form field\'s label; for Joomla 2.5.4+\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties11\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) For Joomla form validating it to be filled in\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Whether to Joomla validate the field according to rules\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Input field for files', '', 1, 10, 0, 3, '6da71c1e-119c-4e0d-a309-f3e52ecfa1d1'),
+(33, 'The Menuitem form field type provides a grouped dropdown list of available menu items from your Joomla site, organized by their respective menus for easier selection.', 'Menuitem', '{\"properties0\":{\"name\":\"type\",\"example\":\"menuitem\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be menuitem.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mymenuitem\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a menu item\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default menu item. Note that this is the ItemID number of the menu item.\"},\"properties4\":{\"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.\"},\"properties5\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) determines whether all menu items are listed or only published menu items. If state is \'0\' then all menu items will be listed. If state is \'1\' then only published menu items will be listed.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"int\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Dropdown list of items within a selected menu.', '', 1, 7, 0, 4, 'f183b0e2-017f-48bd-8dba-d332ce1b8d9e'),
+(34, 'Remember all views already have [accesslevel] added by default, only add this if you need more custom access selection! Provides a dropdown list of accesslevel options with the current option selected.', 'Accesslevel', '{\"properties0\":{\"name\":\"type\",\"example\":\"accesslevel\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be accesslevel\"},\"properties1\":{\"name\":\"name\",\"example\":\"accesstwo\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute. \"},\"properties2\":{\"name\":\"label\",\"example\":\"Access Two\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select an access level to this concept.\",\"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\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the field required true if yes.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties7\":{\"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\"}}', 'List of user accesslevels.', '', 1, 8, 0, 5, '913ed2ce-836c-48e8-97af-e482441f47df'),
+(35, 'Provides a form containing repeatable rows of nested fields that you define. Users can add as many entries as needed, with each row replicating the specified field structure. This field type relies on a jQuery-based JavaScript file to handle dynamic behaviour and is ideal for managing structured, multi-value input.', 'Subform', '{\"properties0\":{\"name\":\"type\",\"example\":\"subform\",\"description\":\"(mandatory) must be subform.\"},\"properties1\":{\"name\":\"name\",\"example\":\"options\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Option List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"layout\",\"example\":\"joomla.form.field.subform.repeatable-table\",\"adjustable\":\"1\",\"description\":\"(mandatory) The layout for the repeatable table.\"},\"properties4\":{\"name\":\"component\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) To change the component where it should search for layout\"},\"properties5\":{\"name\":\"client\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Function to initialise the application clientFrontend: site or 0Backend: admin or 1\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The rows to be multiple.\"},\"properties7\":{\"name\":\"buttons\",\"example\":\"add,remove,move\",\"adjustable\":\"1\",\"description\":\"(optional) Which buttons to show if multiple mode is true.Options: add,remove,move\"},\"properties8\":{\"name\":\"fields\",\"example\":\"guid,guid,guid\",\"adjustable\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids\\/guids with commas. Do not add custom fields that are not also used in this component.\"},\"properties9\":{\"name\":\"formsource\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) you can add a path to a xml file containing the fields.\"},\"properties10\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties11\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties12\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties13\":{\"name\":\"max\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties14\":{\"name\":\"min\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The minimum number of rows of fields required\"},\"properties15\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties16\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Repeating sets of nested form fields.', '', 1, 16, 0, 6, '7139f2c8-a70a-46a6-bbe3-4eefe54ca515'),
+(36, 'A field type that provides an input for entering an email address. It includes basic validation to ensure the input matches the standard email format, helping to prevent invalid entries.', 'Email', '{\"properties0\":{\"name\":\"type\",\"example\":\"email\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be email.\"},\"properties1\":{\"name\":\"name\",\"example\":\"email\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Email Address\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"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 \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"email\",\"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\":\"unique\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) Used in validation, to check if we should test for uniqueness, to insure that this email does not already belong to another user. Check line 99 in \\/libraries\\/src\\/Form\\/Rule\\/EmailRule.php\"},\"properties14\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"your@email.com\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties17\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties18\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties19\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Email form field type.', '', 1, 8, 0, 7, '35948af5-9e79-4454-8dfa-682ee4fdf650'),
+(37, 'The Plugins form field type provides a dropdown list of available plugins from a specified plugin folder. It allows selection from plugins grouped under a particular type (folder), making it useful when an extension needs to reference or configure specific plugin functionality within Joomla. The list is dynamically populated based on the plugins installed in the defined folder.', 'Plugins', '{\"properties0\":{\"name\":\"type\",\"example\":\"plugins\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editors.\"},\"properties1\":{\"name\":\"name\",\"example\":\"editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"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 label.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"folder\",\"example\":\"editors\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) editors or captcha.\"},\"properties7\":{\"name\":\"filter\",\"example\":\"cmd\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties8\":{\"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\"}}', 'Dropdown of plugins from a specified folder.', '', 1, 10, 0, 8, '37fa4e1d-b7ca-4a8f-aa4b-d8085c135233'),
+(38, 'The Captcha field type that integrates with a Joomla captcha plugin to present a human verification challenge, typically used to distinguish between human users and automated systems.', 'Captcha', '{\"properties0\":{\"name\":\"type\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties1\":{\"name\":\"name\",\"example\":\"captcha\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"validate\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties3\":{\"name\":\"label\",\"example\":\"Captcha\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"We do not like spam, please show us you are human\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"namespace\",\"example\":\"componentbuilder\",\"description\":\"(optional) the component name seems to work\"}}', 'Captcha robot check.', '', 1, 4, 0, 9, '206fdad4-14d0-45f1-9c84-3d09abf48a39'),
+(39, 'The groupedlist form field type provides a drop down list or list box of custom-defined entries, organized into labeled groups. 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.', 'Groupedlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"groupedlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be groupedlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mygrouplist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"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\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"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\":\"option\",\"example\":\"Group Name@@1,1|Option 1|1,2|Option 2|1,Group Name 2@@2,3|Option 3|2\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties11\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties12\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Dropdown list of grouped custom entries.', '', 1, 5, 0, 10, '088d47c0-b058-4894-b92e-dcf1b9d5a722'),
+(40, 'The Modulelayout form field type provides a drop down list of all available layouts for a module, grouped by core and template. 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.', 'Modulelayout', '{\"properties0\":{\"name\":\"type\",\"example\":\"modulelayout\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be modulelayout.\"},\"properties1\":{\"name\":\"name\",\"example\":\"layout\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Layout\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Module layout\",\"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\":\"module\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a specific module name (e.g. mod_articles_category).\"},\"properties5\":{\"name\":\"client_id\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional). If 0 (site): Forces searching for layouts only in directories \\/modules\\/[MODULENAME]\\/tmpl\\/ and all \\/templates\\/[TEMPLATENAME]\\/html\\/[MODULENAME]\\/. If 1 (administrator): Forces searching for layouts only in directories \\/administrator\\/modules\\/[MODULENAME]\\/tmpl\\/ and all \\/administrator\\/templates\\/[TEMPLATENAME]\\/html\\/[MODULENAME]\\/.\\r\\n\"},\"properties6\":{\"name\":\"template\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a template name (e.g. protostar or isis). If set forces searching for module template overrides only in this template.\"}}', 'Dropdown of module layouts.', '', 1, 4, 0, 11, '7520c8f4-543d-4c7a-8e4f-e2da71c3b1cd'),
+(41, 'The privacy field type in Joomla is a specialized custom form field introduced to assist extensions in handling privacy-related features; most notably, export and deletion requests in compliance with privacy regulations like the GDPR (General Data Protection Regulation).', 'Privacy@', '{\"properties0\":{\"name\":\"type\",\"example\":\"privacy\",\"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\":\"privacy\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Privacy Policy\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Read the full privacy policy.\",\"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\":\"filter\",\"example\":\"integer\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|I agree,0|No\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties7\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties10\":{\"name\":\"extends\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"Must be radio\"},\"properties11\":{\"name\":\"type_phpHEADER_1\",\"example\":\"use Joomla\\\\CMS\\\\Factory;\\r\\nuse Joomla\\\\CMS\\\\Language\\\\Text;\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The Header USE options\"},\"properties12\":{\"name\":\"type_php_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the field input markup.\\r\\n\\t *\\r\\n\\t * @return string The field input markup.\\r\\n\\t *\\r\\n\\t * @since 3.9.0\\r\\n\\t *\\/\\r\\n\\tprotected function getInput()\\r\\n\\t{\\r\\n\\t\\t\\/\\/ Display the message before the field\\r\\n\\t\\techo $this->getRenderer(\'plugins.system.privacyconsent.message\')->render($this->getLayoutData());\\r\\n\\r\\n\\t\\treturn parent::getInput();\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getInput method.\"},\"properties13\":{\"name\":\"type_phpa_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the field label markup.\\r\\n\\t *\\r\\n\\t * @return string The field label markup.\\r\\n\\t *\\r\\n\\t * @since 3.9.0\\r\\n\\t *\\/\\r\\n\\tprotected function getLabel()\\r\\n\\t{\\r\\n\\t\\tif ($this->hidden)\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn \'\';\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\treturn $this->getRenderer(\'plugins.system.privacyconsent.label\')->render($this->getLayoutData());\\r\\n\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLabel method.\"},\"properties14\":{\"name\":\"type_phpb_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the data to be passed to the layout for rendering.\\r\\n\\t *\\r\\n\\t * @return array\\r\\n\\t *\\r\\n\\t * @since 3.9.4\\r\\n\\t *\\/\\r\\n\\tprotected function getLayoutData()\\r\\n\\t{\\r\\n\\t\\t$data = parent::getLayoutData();\\r\\n\\r\\n\\t\\t$article = false;\\r\\n\\t\\t$privacyArticle = $this->element[\'article\'] > 0 ? (int) $this->element[\'article\'] : 0;\\r\\n\\r\\n\\t\\tif ($privacyArticle && Factory::getApplication()->isClient(\'site\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$db = Factory::getDbo();\\r\\n\\t\\t\\t$query = $db->getQuery(true)\\r\\n\\t\\t\\t\\t->select($db->quoteName(array(\'id\', \'alias\', \'catid\', \'language\')))\\r\\n\\t\\t\\t\\t->from($db->quoteName(\'#__content\'))\\r\\n\\t\\t\\t\\t->where($db->quoteName(\'id\') . \' = \' . (int) $privacyArticle);\\r\\n\\t\\t\\t$db->setQuery($query);\\r\\n\\t\\t\\t$article = $db->loadObject();\\r\\n\\r\\n\\t\\t\\tJLoader::register(\'ContentHelperRoute\', JPATH_BASE . \'\\/components\\/com_content\\/helpers\\/route.php\');\\r\\n\\r\\n\\t\\t\\t$slug = $article->alias ? ($article->id . \':\' . $article->alias) : $article->id;\\r\\n\\t\\t\\t$article->link = ContentHelperRoute::getArticleRoute($slug, $article->catid, $article->language);\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$extraData = array(\\r\\n\\t\\t\\t\'privacynote\' => !empty($this->element[\'note\']) ? $this->element[\'note\'] : Text::_(\'By signing up to this web site and agreeing to the Privacy Policy you agree to this web site storing your information.\'),\\r\\n\\t\\t\\t\'options\' => $this->getOptions(),\\r\\n\\t\\t\\t\'value\' => (string) $this->value,\\r\\n\\t\\t\\t\'translateLabel\' => $this->translateLabel,\\r\\n\\t\\t\\t\'translateDescription\' => $this->translateDescription,\\r\\n\\t\\t\\t\'translateHint\' => $this->translateHint,\\r\\n\\t\\t\\t\'privacyArticle\' => $privacyArticle,\\r\\n\\t\\t\\t\'article\' => $article,\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\treturn array_merge($data, $extraData);\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLayoutData method.\"}}', 'Joomla privacy field display.', '', 1, 10, 0, 12, '60c1d674-8bb7-4b31-97ed-ee1f16bc412a'),
+(42, 'The terms field type displays Joomla\'s terms and conditions agreement checkbox, typically used in user registration or other consent-based forms. It ensures that users acknowledge and accept the site\'s legal terms before proceeding, in compliance with privacy or legal requirements. The terms content is managed through Joomla\'s configuration.', 'Terms@', '{\"properties0\":{\"name\":\"type\",\"example\":\"terms\",\"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\":\"terms\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Terms & Conditions\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Read the full terms and conditions.\",\"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\":\"filter\",\"example\":\"integer\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|I agree,0|No\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties7\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties10\":{\"name\":\"extends\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"Must be radio\"},\"properties11\":{\"name\":\"type_phpHEADER_1\",\"example\":\"use Joomla\\\\CMS\\\\Factory;\\r\\nuse Joomla\\\\CMS\\\\Form\\\\FormHelper;\\r\\nuse Joomla\\\\CMS\\\\Language\\\\Associations;\\r\\nuse Joomla\\\\CMS\\\\Language\\\\Text;\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The Header USE options\"},\"properties12\":{\"name\":\"type_php_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the field input markup.\\r\\n\\t *\\r\\n\\t * @return string The field input markup.\\r\\n\\t *\\r\\n\\t * @since 3.9.0\\r\\n\\t *\\/\\r\\n\\tprotected function getInput()\\r\\n\\t{\\r\\n\\t\\t\\/\\/ Display the message before the field\\r\\n\\t\\techo $this->getRenderer(\'plugins.user.terms.message\')->render($this->getLayoutData());\\r\\n\\r\\n\\t\\treturn parent::getInput();\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getInput method.\"},\"properties13\":{\"name\":\"type_phpa_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the field label markup.\\r\\n\\t *\\r\\n\\t * @return string The field label markup.\\r\\n\\t *\\r\\n\\t * @since 3.9.0\\r\\n\\t *\\/\\r\\n\\tprotected function getLabel()\\r\\n\\t{\\r\\n\\t\\tif ($this->hidden)\\r\\n\\t\\t{\\r\\n\\t\\t\\treturn \'\';\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\treturn $this->getRenderer(\'plugins.user.terms.label\')->render($this->getLayoutData());\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLabel method.\"},\"properties14\":{\"name\":\"type_phpb_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the data to be passed to the layout for rendering.\\r\\n\\t *\\r\\n\\t * @return array\\r\\n\\t *\\r\\n\\t * @since 3.9.4\\r\\n\\t *\\/\\r\\n\\tprotected function getLayoutData()\\r\\n\\t{\\r\\n\\t\\t$data = parent::getLayoutData();\\r\\n\\r\\n\\t\\t$article = false;\\r\\n\\t\\t$termsArticle = $this->element[\'article\'] > 0 ? (int) $this->element[\'article\'] : 0;\\r\\n\\r\\n\\t\\tif ($termsArticle && Factory::getApplication()->isClient(\'site\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$db = Factory::getDbo();\\r\\n\\t\\t\\t$query = $db->getQuery(true)\\r\\n\\t\\t\\t\\t->select($db->quoteName(array(\'id\', \'alias\', \'catid\', \'language\')))\\r\\n\\t\\t\\t\\t->from($db->quoteName(\'#__content\'))\\r\\n\\t\\t\\t\\t->where($db->quoteName(\'id\') . \' = \' . (int) $termsArticle);\\r\\n\\t\\t\\t$db->setQuery($query);\\r\\n\\t\\t\\t$article = $db->loadObject();\\r\\n\\r\\n\\t\\t\\tJLoader::register(\'ContentHelperRoute\', JPATH_BASE . \'\\/components\\/com_content\\/helpers\\/route.php\');\\r\\n\\r\\n\\t\\t\\tif (Associations::isEnabled())\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$termsAssociated = Associations::getAssociations(\'com_content\', \'#__content\', \'com_content.item\', $termsArticle);\\r\\n\\t\\t\\t}\\r\\n\\r\\n\\t\\t\\t$currentLang = Factory::getLanguage()->getTag();\\r\\n\\r\\n\\t\\t\\tif (isset($termsAssociated) && $currentLang !== $article->language && array_key_exists($currentLang, $termsAssociated))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$article->link = ContentHelperRoute::getArticleRoute(\\r\\n\\t\\t\\t\\t\\t$termsAssociated[$currentLang]->id,\\r\\n\\t\\t\\t\\t\\t$termsAssociated[$currentLang]->catid,\\r\\n\\t\\t\\t\\t\\t$termsAssociated[$currentLang]->language\\r\\n\\t\\t\\t\\t);\\r\\n\\t\\t\\t}\\r\\n\\t\\t\\telse\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$slug = $article->alias ? ($article->id . \':\' . $article->alias) : $article->id;\\r\\n\\t\\t\\t\\t$article->link = ContentHelperRoute::getArticleRoute($slug, $article->catid, $article->language);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$extraData = array(\\r\\n\\t\\t\\t\'termsnote\' => !empty($this->element[\'note\']) ? $this->element[\'note\'] : Text::_(\'By signing up to this web site you accept the Terms & Conditions.\'),\\r\\n\\t\\t\\t\'options\' => $this->getOptions(),\\r\\n\\t\\t\\t\'value\' => (string) $this->value,\\r\\n\\t\\t\\t\'translateLabel\' => $this->translateLabel,\\r\\n\\t\\t\\t\'translateDescription\' => $this->translateDescription,\\r\\n\\t\\t\\t\'translateHint\' => $this->translateHint,\\r\\n\\t\\t\\t\'termsArticle\' => $termsArticle,\\r\\n\\t\\t\\t\'article\' => $article,\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\treturn array_merge($data, $extraData);\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLayoutData method.\"}}', 'Displays Joomla terms and conditions.', '', 1, 8, 0, 12, '20e88943-08db-49e6-a571-dba70cdf4cca'),
+(43, 'A field type that combines a standard text input with a dropdown list of predefined options. Users can either type a custom value or choose from the available selections, offering flexibility in data entry.', 'Combo', '{\"properties0\":{\"name\":\"type\",\"example\":\"combo\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be combo.\"},\"properties1\":{\"name\":\"name\",\"example\":\"type\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Type\",\"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) tooltip for the form field.\"},\"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\":\"combobox\",\"adjustable\":\"1\",\"description\":\"(optional) specify your own classes for additonal markup, defaults to \\\"combobox\\\".\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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.\"},\"properties9\":{\"name\":\"option\",\"example\":\"0|Option 1,1|Option 2,2|Option 1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties10\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties12\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Combobox list field, allows free text.', '', 1, 4, 0, 13, '2c8b128f-7da2-4f55-b1d7-3613f902f590'),
+(44, 'The imagelist form field type provides a drop down list of image files in a specified directory. Only files with .png, .gif, .jpg, .bmp, .ico extensions are listed. 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.\r\n\r\nBy default, the first item on the list is \'- Do not use -\' (which is translatable) and is given the value \'-1\' and this is followed by \'- Use default -\' (also translatable) given the value \'0\'.', 'Imagelist', '{\"properties0\":{\"name\":\"type\",\"example\":\"imagelist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be imagelist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myimagelist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an image\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\\/stories\",\"adjustable\":\"1\",\"description\":\"(optional) is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default image file name.\"},\"properties5\":{\"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.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of image files selected for inclusion in the drop-down list. If omitted, all image files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude image files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"stripext\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true then file name extensions will be stripped from the image file names listed. Also note that the file name will be saved without the extension too.\"},\"properties9\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties10\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties11\":{\"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\"}}', 'Image file dropdown from directory.', '', 1, 4, 0, 14, '72680e92-2859-49c6-ad92-c2329c52f9f8'),
+(45, ' The Modal menu form field type provides a styled drop-down list of Joomla menu items, visually matching Joomla\'s modal UI patterns. Unlike the modal select field type, it does not open a modal window for selection but instead presents menu items in a compact, dropdown format consistent with the modal design language used in Joomla\'s administrator interface.', 'Modal Menu', '{\"properties0\":{\"name\":\"type\",\"example\":\"modal_menu\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be modal_menu.\"},\"properties1\":{\"name\":\"name\",\"example\":\"base\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Base Item\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"option\",\"example\":\"Current\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties4\":{\"name\":\"select\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) show select options\"},\"properties5\":{\"name\":\"new\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties6\":{\"name\":\"edit\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties7\":{\"name\":\"description\",\"example\":\"Select a menu item to always be used as the base for the menu display. You must set the Start Level to the same level or higher than the level of the base item. This will cause the module to be displayed on all assigned pages. If Current is selected the active item is used as the base. This causes the module to only display when the parent menu item is active.\",\"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.\"},\"properties8\":{\"name\":\"clear\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory)\"},\"properties9\":{\"name\":\"disable\",\"example\":\"separator,alias,heading,url\",\"adjustable\":\"1\",\"description\":\"(optional)\"},\"properties10\":{\"name\":\"filter\",\"example\":\"integer\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of image files selected for inclusion in the drop-down list. If omitted, all image files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties11\":{\"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\\r\\n\"}}', 'Styled dropdown of menu items.', '', 1, 8, 0, 15, '715256a4-8cc2-4d66-9d08-31e58ca5b036'),
+(46, 'The menu form field type provides a drop down list of the available menus from your Joomla! site. 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. ', 'Menu', '{\"properties0\":{\"name\":\"type\",\"example\":\"menu\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be menu.\"},\"properties1\":{\"name\":\"name\",\"example\":\"menutype\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the filed.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Menu to Show\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Choose which menu should be rendered with this instance of module.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties4\":{\"name\":\"clientid\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default menu. Note that this is the name of the menu shown in the Type column on the Menu Manager screen and not the menu ID number.\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties7\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Dropdown list of Joomla menus.', '', 1, 6, 0, 16, '6349f152-8ef5-43bd-a89b-ce18f33ac5e5'),
+(47, 'Dynamic Checkboxes generates a list of checkboxes dynamically based on data retrieved at runtime, such as from a database query or external source. Useful for displaying variable options that may change depending on context or configuration.', 'DynamicCheckboxes@', '{\"properties0\":{\"name\":\"type\",\"example\":\"change_this\",\"adjustable\":\"1\",\"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\":\"dynamic_checkboxes\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Dynamic Checkboxes\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"The checkbox linked to global subform of the same name\",\"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\":\"option\",\"example\":\"1|Default\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this checkboxes. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties5\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"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\"},\"properties8\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties9\":{\"name\":\"extends\",\"example\":\"checkboxes\",\"mandatory\":\"1\",\"description\":\"Must be checkboxes\"},\"properties10\":{\"name\":\"type_phpHEADER_1\",\"example\":\"\\\\JFormHelper::loadFieldClass(\'checkboxes\');\\r\\nuse VDM\\\\Joomla\\\\Utilities\\\\Component\\\\Helper;\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The Header USE options\"},\"properties11\":{\"name\":\"type_php_1\",\"example\":\"\\t\\/**\\r\\n\\t * Method to get the data to be passed to the layout for rendering.\\r\\n\\t *\\r\\n\\t * @return array\\r\\n\\t *\\r\\n\\t * @since 3.5\\r\\n\\t *\\/\\r\\n\\tprotected function getLayoutData()\\r\\n\\t{\\r\\n\\t\\t$data = parent::getLayoutData();\\r\\n\\r\\n\\t\\t\\/\\/ True if the field has \'value\' set. In other words, it has been stored, don\'t use the default values.\\r\\n\\t\\t$hasValue = (isset($this->value) && !empty($this->value));\\r\\n\\r\\n\\t\\t\\/\\/ If a value has been stored, use it. Otherwise, use the defaults.\\r\\n\\t\\t$checkedOptions = $hasValue ? $this->value : $this->checkedOptions;\\r\\n\\r\\n\\t\\t\\/\\/ get the form options\\r\\n\\t\\t$options = $this->getOptions();\\r\\n\\r\\n\\t\\t\\/\\/ get the component params\\r\\n\\t\\t$params = Helper::getParams();\\r\\n\\t\\t$subform = $params->get($this->fieldname);\\r\\n\\r\\n\\t\\t\\/\\/ add the paths found in global settings\\r\\n\\t\\tif (is_array($subform) && $subform !== [])\\r\\n\\t\\t{\\r\\n\\t\\t\\tforeach ($subform as $value)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\tif (isset($value->path) && strlen($value->path) > 3)\\r\\n\\t\\t\\t\\t{\\r\\n\\t\\t\\t\\t\\t$tmp = new \\\\stdClass;\\r\\n\\t\\t\\t\\t\\t$tmp->value = $value->set_me;\\r\\n\\t\\t\\t\\t\\t$tmp->text = $value->set_me;\\r\\n\\t\\t\\t\\t\\t$tmp->checked = false;\\r\\n\\r\\n\\t\\t\\t\\t\\t$options[] = $tmp;\\r\\n\\t\\t\\t\\t}\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\r\\n\\t\\t$extraData = array(\\r\\n\\t\\t\\t\'checkedOptions\' => is_array($checkedOptions) ? $checkedOptions : explode(\',\', (string) $checkedOptions),\\r\\n\\t\\t\\t\'hasValue\' => $hasValue,\\r\\n\\t\\t\\t\'options\' => $options\\r\\n\\t\\t);\\r\\n\\r\\n\\t\\treturn array_merge($data, $extraData);\\r\\n\\t}\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The php for the getLayoutData method.\"}}', 'Super Power Repository Paths', '', 1, 15, 0, 12, '7ed21e79-cbc5-48e3-9ed0-ca72b0f2f1a1');
--
-- Dumping data for table `#__componentbuilder_language`
--
-
INSERT INTO `#__componentbuilder_language` (`id`, `langtag`, `name`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
-(1, 'af-ZA', 'Afrikaans', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(2, 'sq-AL', 'Albanian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(3, 'ar-AA', 'Arabic Unitag', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(4, 'hy-AM', 'Armenian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(5, 'id-ID', 'Indonesian, Bahasa Indonesia', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(6, 'eu-ES', 'Basque', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(7, 'be-BY', 'Belarusian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(8, 'bn-BD', 'Bengali, Bangladesh', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(9, 'bs-BA', 'Bosnian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(10, 'bg-BG', 'Bulgarian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(11, 'ca-ES', 'Catalan', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(12, 'zh-CN', 'Chinese, Simplified', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(13, 'zh-TW', 'Chinese, Traditional', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(14, 'hr-HR', 'Croatian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(15, 'cs-CZ', 'Czech', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(16, 'da-DK', 'Danish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(17, 'prs-AF', 'Dari Persian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(18, 'nl-NL', 'Dutch', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(19, 'dz-BT', 'Dzongkha', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(20, 'en-AU', 'English, Australia', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(21, 'en-CA', 'English, Canada', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(22, 'en-GB', 'English GB', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(23, 'en-NZ', 'English, New Zealand', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(24, 'en-US', 'English, USA', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(25, 'eo-XX', 'Esperanto', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(26, 'et-EE', 'Estonian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(27, 'fi-FI', 'Finnish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(28, 'nl-BE', 'Flemish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(29, 'fr-FR', 'French', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(30, 'fr-CA', 'French, Canada', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(31, 'gl-ES', 'Galician', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(32, 'ka-GE', 'Georgian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(33, 'de-AT', 'German, Austria', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(34, 'de-CH', 'German, Switzerland', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(35, 'de-DE', 'German', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(36, 'de-LI', 'German, Liechtenstein', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(37, 'de-LU', 'German, Luxembourg', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(38, 'el-GR', 'Greek', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(39, 'he-IL', 'Hebrew', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(40, 'hi-IN', 'Hindi, India', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(41, 'hu-HU', 'Hungarian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(42, 'ga-IE', 'Irish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(43, 'it-IT', 'Italian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(44, 'ja-JP', 'Japanese', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(45, 'km-KH', 'Khmer', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(46, 'ko-KR', 'Korean', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(47, 'lv-LV', 'Latvian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(48, 'mk-MK', 'Macedonian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(49, 'ms-MY', 'Malay', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(50, 'srp-ME', 'Montenegrin', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(51, 'nb-NO', 'Norwegian Bokmål', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(52, 'nn-NO', 'Norwegian Nynorsk', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(53, 'fa-IR', 'Persian Farsi', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(54, 'pl-PL', 'Polish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(55, 'pt-PT', 'Portuguese, Portugal', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(56, 'pt-BR', 'Portuguese, Brazil', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(57, 'ro-RO', 'Romanian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(58, 'ru-RU', 'Russian', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 6, '', 1),
-(59, 'sr-RS', 'Serbian, Cyrillic', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(60, 'sr-YU', 'Serbian, Latin', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(61, 'si-LK', 'Sinhala', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(62, 'sk-SK', 'Slovak', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(63, 'sl-SI', 'Slovenian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(64, 'es-ES', 'Spanish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(65, 'es-CO', 'Spanish, Colombia', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(66, 'sw-KE', 'Swahili', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(67, 'sv-SE', 'Swedish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(68, 'sy-IQ', 'Syriac, East', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(69, 'ta-IN', 'Tamil, India', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(70, 'th-TH', 'Thai', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(71, 'tr-TR', 'Turkish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(72, 'tk-TM', 'Turkmen', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(73, 'uk-UA', 'Ukrainian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(74, 'ug-CN', 'Uyghur', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(75, 'vi-VN', 'Vietnamese', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(76, 'cy-GB', 'Welsh', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, '', 1),
-(77, 'lt-LT', 'Lithuanian', '', 2, '2018-09-14 10:39:11', '2023-12-26 07:40:20', 4, '', 2),
-(78, 'kk-KZ', 'Kazakh', '', 2, '2020-03-19 13:41:00', '2023-12-26 07:40:20', 3, '', 3);
+(1, 'af-ZA', 'Afrikaans', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(2, 'sq-AL', 'Albanian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(3, 'ar-AA', 'Arabic Unitag', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(4, 'hy-AM', 'Armenian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(5, 'id-ID', 'Indonesian, Bahasa Indonesia', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(6, 'eu-ES', 'Basque', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(7, 'be-BY', 'Belarusian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(8, 'bn-BD', 'Bengali, Bangladesh', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(9, 'bs-BA', 'Bosnian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(10, 'bg-BG', 'Bulgarian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(11, 'ca-ES', 'Catalan', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(12, 'zh-CN', 'Chinese, Simplified', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(13, 'zh-TW', 'Chinese, Traditional', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(14, 'hr-HR', 'Croatian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(15, 'cs-CZ', 'Czech', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(16, 'da-DK', 'Danish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(17, 'prs-AF', 'Dari Persian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(18, 'nl-NL', 'Dutch', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(19, 'dz-BT', 'Dzongkha', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(20, 'en-AU', 'English, Australia', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(21, 'en-CA', 'English, Canada', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(22, 'en-GB', 'English GB', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(23, 'en-NZ', 'English, New Zealand', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(24, 'en-US', 'English, USA', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(25, 'eo-XX', 'Esperanto', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(26, 'et-EE', 'Estonian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(27, 'fi-FI', 'Finnish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(28, 'nl-BE', 'Flemish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(29, 'fr-FR', 'French', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(30, 'fr-CA', 'French, Canada', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(31, 'gl-ES', 'Galician', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(32, 'ka-GE', 'Georgian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(33, 'de-AT', 'German, Austria', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(34, 'de-CH', 'German, Switzerland', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(35, 'de-DE', 'German', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(36, 'de-LI', 'German, Liechtenstein', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(37, 'de-LU', 'German, Luxembourg', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(38, 'el-GR', 'Greek', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(39, 'he-IL', 'Hebrew', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(40, 'hi-IN', 'Hindi, India', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(41, 'hu-HU', 'Hungarian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(42, 'ga-IE', 'Irish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(43, 'it-IT', 'Italian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(44, 'ja-JP', 'Japanese', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(45, 'km-KH', 'Khmer', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(46, 'ko-KR', 'Korean', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(47, 'lv-LV', 'Latvian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(48, 'mk-MK', 'Macedonian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(49, 'ms-MY', 'Malay', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(50, 'srp-ME', 'Montenegrin', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(51, 'nb-NO', 'Norwegian Bokmål', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(52, 'nn-NO', 'Norwegian Nynorsk', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(53, 'fa-IR', 'Persian Farsi', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(54, 'pl-PL', 'Polish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(55, 'pt-PT', 'Portuguese, Portugal', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(56, 'pt-BR', 'Portuguese, Brazil', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(57, 'ro-RO', 'Romanian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(58, 'ru-RU', 'Russian', '', 1, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 6, 0, 1),
+(59, 'sr-RS', 'Serbian, Cyrillic', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(60, 'sr-YU', 'Serbian, Latin', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(61, 'si-LK', 'Sinhala', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(62, 'sk-SK', 'Slovak', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(63, 'sl-SI', 'Slovenian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(64, 'es-ES', 'Spanish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(65, 'es-CO', 'Spanish, Colombia', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(66, 'sw-KE', 'Swahili', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(67, 'sv-SE', 'Swedish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(68, 'sy-IQ', 'Syriac, East', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(69, 'ta-IN', 'Tamil, India', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(70, 'th-TH', 'Thai', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(71, 'tr-TR', 'Turkish', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(72, 'tk-TM', 'Turkmen', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(73, 'uk-UA', 'Ukrainian', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(74, 'ug-CN', 'Uyghur', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(75, 'vi-VN', 'Vietnamese', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(76, 'cy-GB', 'Welsh', '', 2, '2018-04-19 13:43:44', '2023-12-26 07:40:20', 5, 0, 1),
+(77, 'lt-LT', 'Lithuanian', '', 2, '2018-09-14 10:39:11', '2023-12-26 07:40:20', 4, 0, 2),
+(78, 'kk-KZ', 'Kazakh', '', 2, '2020-03-19 13:41:00', '2023-12-26 07:40:20', 3, 0, 3);
--
-- Dumping data for table `#__componentbuilder_repository`
--
-
INSERT INTO `#__componentbuilder_repository` (`id`, `system_name`, `organisation`, `repository`, `target`, `type`, `base`, `guid`, `read_branch`, `access`, `ordering`, `published`, `modified`, `created`, `params`, `addplaceholders`) VALUES
-(14, 'Super Powers (codeberg - mirror)', 'joomla', 'super-powers', 1, 1, 'https://codeberg.org', '8213b3a3-8618-4b29-92b3-15c9f26f019c', 'master', 1, 14, 1, '2024-09-16 17:22:02', '2024-06-10 10:59:35', '', '{}'),
-(15, 'PHP Seclib (codeberg - mirror)', 'joomla', 'phpseclib', 1, 1, 'https://codeberg.org', '64a84f86-391e-4e4b-be99-b2c7c41a6005', 'master', 1, 15, 1, '2024-09-16 17:22:09', '2024-06-10 11:02:03', '', '{}'),
-(16, 'Gitea (codeberg - mirror)', 'joomla', 'gitea', 1, 1, 'https://codeberg.org', 'cb800a2c-4bf7-41c8-9360-cfe9d54cdf2b', 'master', 1, 16, 1, '2024-09-16 17:22:14', '2024-06-10 11:03:09', '', '{}'),
-(17, 'Openai (codeberg - mirror)', 'joomla', 'openai', 1, 1, 'https://codeberg.org', 'c625381a-7795-4b9f-8b4e-997c9291e3fc', 'master', 1, 17, 1, '2024-09-16 17:22:20', '2024-06-10 11:03:19', '', '{}'),
-(18, 'Joomla Powers (codeberg - mirror)', 'joomla', 'joomla-powers', 2, 1, 'https://codeberg.org', '8ac595d4-0b1d-4877-ba3e-2b815c1c7e3c', 'master', 1, 18, 1, '2024-09-16 17:22:27', '2024-07-08 14:07:31', '', '{}'),
-(19, 'Joomla Field Types (codeberg - mirror)', 'joomla', 'joomla-fieldtypes', 3, 1, 'https://codeberg.org', 'bf4a1d77-e3a4-4aa8-a07f-2b01872bf7e9', 'master', 1, 19, 1, '2024-09-16 17:22:32', '2024-08-23 16:21:35', '', '{}');
+(14, 'Super Powers (codeberg - mirror)', 'joomla', 'super-powers', 1, 1, 'https://codeberg.org', '8213b3a3-8618-4b29-92b3-15c9f26f019c', 'master', 1, 14, 1, '2025-06-17 21:48:15', '2024-06-10 10:59:35', NULL, '{}'),
+(15, 'PHP Seclib (codeberg - mirror)', 'joomla', 'phpseclib', 1, 1, 'https://codeberg.org', '64a84f86-391e-4e4b-be99-b2c7c41a6005', 'master', 1, 15, 1, '2025-06-17 21:48:08', '2024-06-10 11:02:03', NULL, '{}'),
+(16, 'Gitea (codeberg - mirror)', 'joomla', 'gitea', 1, 1, 'https://codeberg.org', 'cb800a2c-4bf7-41c8-9360-cfe9d54cdf2b', 'master', 1, 16, 1, '2025-06-17 21:47:56', '2024-06-10 11:03:09', NULL, '{}'),
+(17, 'Openai (codeberg - mirror)', 'joomla', 'openai', 1, 1, 'https://codeberg.org', 'c625381a-7795-4b9f-8b4e-997c9291e3fc', 'master', 1, 17, 1, '2025-06-17 21:47:49', '2024-06-10 11:03:19', NULL, '{}'),
+(18, 'Joomla Powers (codeberg - mirror)', 'joomla', 'joomla-powers', 2, 1, 'https://codeberg.org', '8ac595d4-0b1d-4877-ba3e-2b815c1c7e3c', 'master', 1, 18, 1, '2025-06-17 21:47:22', '2024-07-08 14:07:31', NULL, '{}'),
+(19, 'Joomla Field Types (codeberg - mirror)', 'joomla', 'joomla-fieldtypes', 3, 1, 'https://codeberg.org', 'bf4a1d77-e3a4-4aa8-a07f-2b01872bf7e9', 'master', 1, 19, 1, '2025-06-17 21:48:25', '2024-08-23 16:21:35', NULL, '{}'),
+(20, 'Packages (github - mirror)', 'joomengine', 'packages', 4, 2, 'https://api.github.com', '562624ab-48bf-4979-9a14-6b10cf3635de', 'master', 1, 20, 1, '2025-06-24 19:43:43', '2025-05-31 08:47:01', NULL, '{}'),
+(21, 'Snippets (github - mirror)', 'joomengine', 'snippets', 5, 2, 'https://api.github.com', '70e85588-bc28-4459-9b29-858f68faae8f', 'master', 1, 21, 1, '2025-06-24 15:11:19', '2025-06-18 10:35:14', NULL, '{}'),
+(22, 'Repositories (github - mirror)', 'joomengine', 'repoindex', 6, 2, 'https://api.github.com', '8f156882-f299-4be2-ad13-fdb2c40bb207', 'master', 1, 22, 1, '2025-06-25 09:26:32', '2025-06-18 18:43:05', NULL, '{}'),
+(23, 'Packages (codeberg - mirror)', 'joomla', 'packages', 4, 1, 'https://codeberg.org', '11298fc6-11a4-4075-bdcb-622ef4f3054d', 'master', 1, 21, 1, '2025-06-24 19:09:18', '2025-06-18 18:43:47', NULL, '{}'),
+(24, 'Snippets (codeberg - mirror)', 'joomla', 'snippets', 5, 1, 'https://codeberg.org', '70a9b44b-0802-4b94-9132-e5f360d0215e', 'master', 1, 22, 1, '2025-06-24 19:09:14', '2025-06-24 15:10:05', NULL, '{}'),
+(25, 'Repositories (codeberg - mirror)', 'joomla', 'repoindex', 6, 1, 'https://codeberg.org', 'a8701724-b77c-4e5a-9efc-61701341e8e5', 'master', 1, 21, 1, '2025-06-24 19:09:09', '2025-06-24 15:10:09', NULL, '{}');
--
-- Dumping data for table `#__componentbuilder_help_document`
--
-
INSERT INTO `#__componentbuilder_help_document` (`id`, `admin_view`, `alias`, `article`, `content`, `groups`, `location`, `site_view`, `target`, `title`, `type`, `url`, `params`, `published`, `version`, `hits`, `ordering`) VALUES
-(1, 'components', '2016-03-04-02-31-55', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
\r\n
Create \r\n
You can create a component by clicking on the\r\n New button in the toolbar, this will open a window where you can add all the needed values to create a new component.
\r\n
Edit \r\n
You can edit components in two ways.
\r\n
\r\n You can click on the box next to the component name and then click on the\r\n Edit button in the toolbar; this will open the component and if you have permission it will give you access to edit the values of a component. \r\n You can simply click on the component name; this will open the component and if you have permission it will give you access to edit the values of a component. \r\n \r\n
Edit State \r\n
You can publish, unpublish, archive, and trash any component by clicking in the boxes next the component names and then click on the corresponding button of the task you want to perform. This will change the state of all the components you’ve selected.
\r\n
If you have trashed a component it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed components. To completely remove these components from your system do the following: first select all the components you want to permanently delete by clicking in the boxes next to the component names and then click on the\r\n Empty trash button in the toolbar. This will permanently delete the components from the database. On the other hand if you would like to change the status of the component to publish, unpublish or archive, click in the boxes next to the component names and then click on the corresponding button of the task you want to perform. This will change the state of all the components you’ve selected.
\r\n
Check-in \r\n
When another user on your Joomla website opens a component the system checks the component out to that user. A little lock will show up next to the component name. When you hover over the lock it will show to you who checked it out and when.
\r\n
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
\r\n
If this feature has not yet checked-in any of the components that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the component names and then click on the\r\n Check-in button in the toolbar, or simply click on the little lock. This will then check in the component, which will mean that it removes the component from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
\r\n
Batch Feature \r\n
You can use the Batch feature to update or copy many components at once by clicking in the boxes next the component names and then click on the\r\n Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the\r\n Process button. Once completed this batch feature will have either copied or updated all the components according to the task you selected.
\r\n
Export & Import \r\n
The export and import feature is some of the most exciting features to the list view of components. With them you can update and create many components at once.
\r\n
Export \r\n
The export option only exports the components selected. So to export all components you must change the limited number of components that are being loaded to \"All\". The box that limits the number of components being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the component records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the components. Next click on the\r\n Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
\r\n
Import \r\n
The import option can be used to create components or update existing components. The way to update existing components is to use the same id as the component you want to update. Best way to do this is to first export the components you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new components via an import, simple leave the id field empty.
\r\n
So once you have your excel document ready you will again open the list view of components and click on the\r\n Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
\r\n
Once you have the file selected you can click on the\r\n Upload File or\r\n Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
\r\n
When the field to column relationship has correctly been mapped you can click on the\r\n continue button at the bottom of the page. This should return you to the list view of components with a success message.
\r\n
Debug \r\n
In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Components', 2, '', '', 1, 12, '', 1),
-(2, 'admin_views', 'welcome-to-the-list-view-of-admin-views', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create an admin view by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new admin view.
Edit You can edit admin views in two ways.
You can click on the box next to the admin view name and then click on the Edit button in the toolbar; this will open the admin view and if you have permission it will give you access to edit the values of an admin view. You can simply click on the admin view name; this will open the admin view and if you have permission it will give you access to edit the values of an admin view. Edit State You can publish, unpublish, archive, and trash any admin view by clicking in the boxes next the admin view names and then click on the corresponding button of the task you want to perform. This will change the state of all the admin views you’ve selected.
If you have trashed an admin view it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed admin views. To completely remove these admin views from your system do the following: first select all the admin views you want to permanently delete by clicking in the boxes next to the admin view names and then click on the Empty trash button in the toolbar. This will permanently delete the admin views from the database. On the other hand if you would like to change the status of the admin view to publish, unpublish or archive, click in the boxes next to the admin view names and then click on the corresponding button of the task you want to perform. This will change the state of all the admin views you’ve selected.
Check-in When another user on your Joomla website opens an admin view the system checks the admin view out to that user. A little lock will show up next to the admin view name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the admin views that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the admin view names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the admin view, which will mean that it removes the admin view from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many admin views at once by clicking in the boxes next the admin view names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the admin views according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of admin views. With them you can update and create many admin views at once.
Export The export option only exports the admin views selected. So to export all admin views you must change the limited number of admin views that are being loaded to \"All\". The box that limits the number of admin views being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the admin view records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the admin views. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create admin views or update existing admin views. The way to update existing admin views is to use the same id as the admin view you want to update. Best way to do this is to first export the admin views you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new admin views via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of admin views and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of admin views with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Admin Views', 2, '', '', 1, 5, '', 2),
-(3, 'custom_admin_views', 'welcome-to-the-list-view-of-custom-admin-views', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a custom admin view by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new custom admin view.
Edit You can edit custom admin views in two ways.
You can click on the box next to the custom admin view name and then click on the Edit button in the toolbar; this will open the custom admin view and if you have permission it will give you access to edit the values of a custom admin view. You can simply click on the custom admin view name; this will open the custom admin view and if you have permission it will give you access to edit the values of a custom admin view. Edit State You can publish, unpublish, archive, and trash any custom admin view by clicking in the boxes next the custom admin view names and then click on the corresponding button of the task you want to perform. This will change the state of all the custom admin views you’ve selected.
If you have trashed a custom admin view it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed custom admin views. To completely remove these custom admin views from your system do the following: first select all the custom admin views you want to permanently delete by clicking in the boxes next to the custom admin view names and then click on the Empty trash button in the toolbar. This will permanently delete the custom admin views from the database. On the other hand if you would like to change the status of the custom admin view to publish, unpublish or archive, click in the boxes next to the custom admin view names and then click on the corresponding button of the task you want to perform. This will change the state of all the custom admin views you’ve selected.
Check-in When another user on your Joomla website opens a custom admin view the system checks the custom admin view out to that user. A little lock will show up next to the custom admin view name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the custom admin views that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the custom admin view names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the custom admin view, which will mean that it removes the custom admin view from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many custom admin views at once by clicking in the boxes next the custom admin view names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the custom admin views according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of custom admin views. With them you can update and create many custom admin views at once.
Export The export option only exports the custom admin views selected. So to export all custom admin views you must change the limited number of custom admin views that are being loaded to \"All\". The box that limits the number of custom admin views being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the custom admin view records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the custom admin views. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create custom admin views or update existing custom admin views. The way to update existing custom admin views is to use the same id as the custom admin view you want to update. Best way to do this is to first export the custom admin views you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new custom admin views via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of custom admin views and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of custom admin views with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Custom Admin Views', 2, '', '', 1, 4, '', 3),
-(4, 'site_views', 'welcome-to-the-list-view-of-site-views', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a site view by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new site view.
Edit You can edit site views in two ways.
You can click on the box next to the site view name and then click on the Edit button in the toolbar; this will open the site view and if you have permission it will give you access to edit the values of a site view. You can simply click on the site view name; this will open the site view and if you have permission it will give you access to edit the values of a site view. Edit State You can publish, unpublish, archive, and trash any site view by clicking in the boxes next the site view names and then click on the corresponding button of the task you want to perform. This will change the state of all the site views you’ve selected.
If you have trashed a site view it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed site views. To completely remove these site views from your system do the following: first select all the site views you want to permanently delete by clicking in the boxes next to the site view names and then click on the Empty trash button in the toolbar. This will permanently delete the site views from the database. On the other hand if you would like to change the status of the site view to publish, unpublish or archive, click in the boxes next to the site view names and then click on the corresponding button of the task you want to perform. This will change the state of all the site views you’ve selected.
Check-in When another user on your Joomla website opens a site view the system checks the site view out to that user. A little lock will show up next to the site view name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the site views that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the site view names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the site view, which will mean that it removes the site view from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many site views at once by clicking in the boxes next the site view names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the site views according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of site views. With them you can update and create many site views at once.
Export The export option only exports the site views selected. So to export all site views you must change the limited number of site views that are being loaded to \"All\". The box that limits the number of site views being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the site view records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the site views. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create site views or update existing site views. The way to update existing site views is to use the same id as the site view you want to update. Best way to do this is to first export the site views you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new site views via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of site views and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of site views with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Site Views', 2, '', '', 1, 3, '', 4),
-(5, 'templates', 'welcome-to-the-list-view-of-templates', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a template by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new template.
Edit You can edit templates in two ways.
You can click on the box next to the template name and then click on the Edit button in the toolbar; this will open the template and if you have permission it will give you access to edit the values of a template. You can simply click on the template name; this will open the template and if you have permission it will give you access to edit the values of a template. Edit State You can publish, unpublish, archive, and trash any template by clicking in the boxes next the template names and then click on the corresponding button of the task you want to perform. This will change the state of all the templates you’ve selected.
If you have trashed a template it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed templates. To completely remove these templates from your system do the following: first select all the templates you want to permanently delete by clicking in the boxes next to the template names and then click on the Empty trash button in the toolbar. This will permanently delete the templates from the database. On the other hand if you would like to change the status of the template to publish, unpublish or archive, click in the boxes next to the template names and then click on the corresponding button of the task you want to perform. This will change the state of all the templates you’ve selected.
Check-in When another user on your Joomla website opens a template the system checks the template out to that user. A little lock will show up next to the template name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the templates that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the template names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the template, which will mean that it removes the template from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many templates at once by clicking in the boxes next the template names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the templates according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of templates. With them you can update and create many templates at once.
Export The export option only exports the templates selected. So to export all templates you must change the limited number of templates that are being loaded to \"All\". The box that limits the number of templates being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the template records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the templates. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create templates or update existing templates. The way to update existing templates is to use the same id as the template you want to update. Best way to do this is to first export the templates you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new templates via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of templates and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of templates with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Templates', 2, '', '', 1, 4, '', 5),
-(6, 'layouts', 'welcome-to-the-list-view-of-layouts', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a layout by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new layout.
Edit You can edit layouts in two ways.
You can click on the box next to the layout name and then click on the Edit button in the toolbar; this will open the layout and if you have permission it will give you access to edit the values of a layout. You can simply click on the layout name; this will open the layout and if you have permission it will give you access to edit the values of a layout. Edit State You can publish, unpublish, archive, and trash any layout by clicking in the boxes next the layout names and then click on the corresponding button of the task you want to perform. This will change the state of all the layouts you’ve selected.
If you have trashed a layout it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed layouts. To completely remove these layouts from your system do the following: first select all the layouts you want to permanently delete by clicking in the boxes next to the layout names and then click on the Empty trash button in the toolbar. This will permanently delete the layouts from the database. On the other hand if you would like to change the status of the layout to publish, unpublish or archive, click in the boxes next to the layout names and then click on the corresponding button of the task you want to perform. This will change the state of all the layouts you’ve selected.
Check-in When another user on your Joomla website opens a layout the system checks the layout out to that user. A little lock will show up next to the layout name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the layouts that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the layout names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the layout, which will mean that it removes the layout from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many layouts at once by clicking in the boxes next the layout names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the layouts according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of layouts. With them you can update and create many layouts at once.
Export The export option only exports the layouts selected. So to export all layouts you must change the limited number of layouts that are being loaded to \"All\". The box that limits the number of layouts being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the layout records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the layouts. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create layouts or update existing layouts. The way to update existing layouts is to use the same id as the layout you want to update. Best way to do this is to first export the layouts you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new layouts via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of layouts and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of layouts with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Layouts', 2, '', '', 1, 3, '', 6),
-(7, 'dynamic_gets', 'welcome-to-the-list-view-of-dynamic-gets', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a dynamic get by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new dynamic get.
Edit You can edit dynamic gets in two ways.
You can click on the box next to the dynamic get name and then click on the Edit button in the toolbar; this will open the dynamic get and if you have permission it will give you access to edit the values of a dynamic get. You can simply click on the dynamic get name; this will open the dynamic get and if you have permission it will give you access to edit the values of a dynamic get. Edit State You can publish, unpublish, archive, and trash any dynamic get by clicking in the boxes next the dynamic get names and then click on the corresponding button of the task you want to perform. This will change the state of all the dynamic gets you’ve selected.
If you have trashed a dynamic get it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed dynamic gets. To completely remove these dynamic gets from your system do the following: first select all the dynamic gets you want to permanently delete by clicking in the boxes next to the dynamic get names and then click on the Empty trash button in the toolbar. This will permanently delete the dynamic gets from the database. On the other hand if you would like to change the status of the dynamic get to publish, unpublish or archive, click in the boxes next to the dynamic get names and then click on the corresponding button of the task you want to perform. This will change the state of all the dynamic gets you’ve selected.
Check-in When another user on your Joomla website opens a dynamic get the system checks the dynamic get out to that user. A little lock will show up next to the dynamic get name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the dynamic gets that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the dynamic get names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the dynamic get, which will mean that it removes the dynamic get from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many dynamic gets at once by clicking in the boxes next the dynamic get names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the dynamic gets according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of dynamic gets. With them you can update and create many dynamic gets at once.
Export The export option only exports the dynamic gets selected. So to export all dynamic gets you must change the limited number of dynamic gets that are being loaded to \"All\". The box that limits the number of dynamic gets being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the dynamic get records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the dynamic gets. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create dynamic gets or update existing dynamic gets. The way to update existing dynamic gets is to use the same id as the dynamic get you want to update. Best way to do this is to first export the dynamic gets you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new dynamic gets via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of dynamic gets and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of dynamic gets with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Dynamic Gets', 2, '', '', 1, 3, '', 7),
-(8, 'snippets', 'welcome-to-the-list-view-of-snippets', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a snippet by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new snippet.
Edit You can edit snippets in two ways.
You can click on the box next to the snippet name and then click on the Edit button in the toolbar; this will open the snippet and if you have permission it will give you access to edit the values of a snippet. You can simply click on the snippet name; this will open the snippet and if you have permission it will give you access to edit the values of a snippet. Edit State You can publish, unpublish, archive, and trash any snippet by clicking in the boxes next the snippet names and then click on the corresponding button of the task you want to perform. This will change the state of all the snippets you’ve selected.
If you have trashed a snippet it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed snippets. To completely remove these snippets from your system do the following: first select all the snippets you want to permanently delete by clicking in the boxes next to the snippet names and then click on the Empty trash button in the toolbar. This will permanently delete the snippets from the database. On the other hand if you would like to change the status of the snippet to publish, unpublish or archive, click in the boxes next to the snippet names and then click on the corresponding button of the task you want to perform. This will change the state of all the snippets you’ve selected.
Check-in When another user on your Joomla website opens a snippet the system checks the snippet out to that user. A little lock will show up next to the snippet name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the snippets that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the snippet names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the snippet, which will mean that it removes the snippet from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many snippets at once by clicking in the boxes next the snippet names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the snippets according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of snippets. With them you can update and create many snippets at once.
Export The export option only exports the snippets selected. So to export all snippets you must change the limited number of snippets that are being loaded to \"All\". The box that limits the number of snippets being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the snippet records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the snippets. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create snippets or update existing snippets. The way to update existing snippets is to use the same id as the snippet you want to update. Best way to do this is to first export the snippets you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new snippets via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of snippets and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of snippets with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Snippets', 2, '', '', 1, 3, '', 8),
-(9, 'fields', 'welcome-to-the-list-view-of-fields', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a field by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new field.
Edit You can edit fields in two ways.
You can click on the box next to the field name and then click on the Edit button in the toolbar; this will open the field and if you have permission it will give you access to edit the values of a field. You can simply click on the field name; this will open the field and if you have permission it will give you access to edit the values of a field. Edit State You can publish, unpublish, archive, and trash any field by clicking in the boxes next the field names and then click on the corresponding button of the task you want to perform. This will change the state of all the fields you’ve selected.
If you have trashed a field it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed fields. To completely remove these fields from your system do the following: first select all the fields you want to permanently delete by clicking in the boxes next to the field names and then click on the Empty trash button in the toolbar. This will permanently delete the fields from the database. On the other hand if you would like to change the status of the field to publish, unpublish or archive, click in the boxes next to the field names and then click on the corresponding button of the task you want to perform. This will change the state of all the fields you’ve selected.
Check-in When another user on your Joomla website opens a field the system checks the field out to that user. A little lock will show up next to the field name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the fields that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the field names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the field, which will mean that it removes the field from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many fields at once by clicking in the boxes next the field names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the fields according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of fields. With them you can update and create many fields at once.
Export The export option only exports the fields selected. So to export all fields you must change the limited number of fields that are being loaded to \"All\". The box that limits the number of fields being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the field records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the fields. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create fields or update existing fields. The way to update existing fields is to use the same id as the field you want to update. Best way to do this is to first export the fields you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new fields via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of fields and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of fields with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Fields', 2, '', '', 1, 3, '', 9),
-(10, 'fieldtypes', 'welcome-to-the-list-view-of-fieldtypes', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a fieldtype by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new fieldtype.
Edit You can edit fieldtypes in two ways.
You can click on the box next to the fieldtype name and then click on the Edit button in the toolbar; this will open the fieldtype and if you have permission it will give you access to edit the values of a fieldtype. You can simply click on the fieldtype name; this will open the fieldtype and if you have permission it will give you access to edit the values of a fieldtype. Edit State You can publish, unpublish, archive, and trash any fieldtype by clicking in the boxes next the fieldtype names and then click on the corresponding button of the task you want to perform. This will change the state of all the fieldtypes you’ve selected.
If you have trashed a fieldtype it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed fieldtypes. To completely remove these fieldtypes from your system do the following: first select all the fieldtypes you want to permanently delete by clicking in the boxes next to the fieldtype names and then click on the Empty trash button in the toolbar. This will permanently delete the fieldtypes from the database. On the other hand if you would like to change the status of the fieldtype to publish, unpublish or archive, click in the boxes next to the fieldtype names and then click on the corresponding button of the task you want to perform. This will change the state of all the fieldtypes you’ve selected.
Check-in When another user on your Joomla website opens a fieldtype the system checks the fieldtype out to that user. A little lock will show up next to the fieldtype name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the fieldtypes that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the fieldtype names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the fieldtype, which will mean that it removes the fieldtype from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many fieldtypes at once by clicking in the boxes next the fieldtype names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the fieldtypes according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of fieldtypes. With them you can update and create many fieldtypes at once.
Export The export option only exports the fieldtypes selected. So to export all fieldtypes you must change the limited number of fieldtypes that are being loaded to \"All\". The box that limits the number of fieldtypes being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the fieldtype records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the fieldtypes. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create fieldtypes or update existing fieldtypes. The way to update existing fieldtypes is to use the same id as the fieldtype you want to update. Best way to do this is to first export the fieldtypes you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new fieldtypes via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of fieldtypes and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of fieldtypes with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Fieldtypes', 2, '', '', 1, 3, '', 10),
-(11, 'help_documents', 'welcome-to-the-list-view-of-help-documents', '', '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a help document by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new help document.
Edit You can edit help documents in two ways.
You can click on the box next to the help document name and then click on the Edit button in the toolbar; this will open the help document and if you have permission it will give you access to edit the values of a help document. You can simply click on the help document name; this will open the help document and if you have permission it will give you access to edit the values of a help document. Edit State You can publish, unpublish, archive, and trash any help document by clicking in the boxes next the help document names and then click on the corresponding button of the task you want to perform. This will change the state of all the help documents you’ve selected.
If you have trashed a help document it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed help documents. To completely remove these help documents from your system do the following: first select all the help documents you want to permanently delete by clicking in the boxes next to the help document names and then click on the Empty trash button in the toolbar. This will permanently delete the help documents from the database. On the other hand if you would like to change the status of the help document to publish, unpublish or archive, click in the boxes next to the help document names and then click on the corresponding button of the task you want to perform. This will change the state of all the help documents you’ve selected.
Check-in When another user on your Joomla website opens a help document the system checks the help document out to that user. A little lock will show up next to the help document name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the help documents that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the help document names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the help document, which will mean that it removes the help document from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many help documents at once by clicking in the boxes next the help document names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the help documents according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of help documents. With them you can update and create many help documents at once.
Export The export option only exports the help documents selected. So to export all help documents you must change the limited number of help documents that are being loaded to \"All\". The box that limits the number of help documents being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the help document records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the help documents. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create help documents or update existing help documents. The way to update existing help documents is to use the same id as the help document you want to update. Best way to do this is to first export the help documents you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new help documents via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of help documents and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of help documents with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Help Documents', 2, '', '', 1, 3, '', 11);
+(1, 'components', '2016-03-04-02-31-55', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
\r\n
Create \r\n
You can create a component by clicking on the\r\n New button in the toolbar, this will open a window where you can add all the needed values to create a new component.
\r\n
Edit \r\n
You can edit components in two ways.
\r\n
\r\n You can click on the box next to the component name and then click on the\r\n Edit button in the toolbar; this will open the component and if you have permission it will give you access to edit the values of a component. \r\n You can simply click on the component name; this will open the component and if you have permission it will give you access to edit the values of a component. \r\n \r\n
Edit State \r\n
You can publish, unpublish, archive, and trash any component by clicking in the boxes next the component names and then click on the corresponding button of the task you want to perform. This will change the state of all the components you’ve selected.
\r\n
If you have trashed a component it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed components. To completely remove these components from your system do the following: first select all the components you want to permanently delete by clicking in the boxes next to the component names and then click on the\r\n Empty trash button in the toolbar. This will permanently delete the components from the database. On the other hand if you would like to change the status of the component to publish, unpublish or archive, click in the boxes next to the component names and then click on the corresponding button of the task you want to perform. This will change the state of all the components you’ve selected.
\r\n
Check-in \r\n
When another user on your Joomla website opens a component the system checks the component out to that user. A little lock will show up next to the component name. When you hover over the lock it will show to you who checked it out and when.
\r\n
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
\r\n
If this feature has not yet checked-in any of the components that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the component names and then click on the\r\n Check-in button in the toolbar, or simply click on the little lock. This will then check in the component, which will mean that it removes the component from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
\r\n
Batch Feature \r\n
You can use the Batch feature to update or copy many components at once by clicking in the boxes next the component names and then click on the\r\n Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the\r\n Process button. Once completed this batch feature will have either copied or updated all the components according to the task you selected.
\r\n
Export & Import \r\n
The export and import feature is some of the most exciting features to the list view of components. With them you can update and create many components at once.
\r\n
Export \r\n
The export option only exports the components selected. So to export all components you must change the limited number of components that are being loaded to \"All\". The box that limits the number of components being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the component records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the components. Next click on the\r\n Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
\r\n
Import \r\n
The import option can be used to create components or update existing components. The way to update existing components is to use the same id as the component you want to update. Best way to do this is to first export the components you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new components via an import, simple leave the id field empty.
\r\n
So once you have your excel document ready you will again open the list view of components and click on the\r\n Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
\r\n
Once you have the file selected you can click on the\r\n Upload File or\r\n Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
\r\n
When the field to column relationship has correctly been mapped you can click on the\r\n continue button at the bottom of the page. This should return you to the list view of components with a success message.
\r\n
Debug \r\n
In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Components', 2, '', '', 1, 12, 0, 1),
+(2, 'admin_views', 'welcome-to-the-list-view-of-admin-views', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create an admin view by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new admin view.
Edit You can edit admin views in two ways.
You can click on the box next to the admin view name and then click on the Edit button in the toolbar; this will open the admin view and if you have permission it will give you access to edit the values of an admin view. You can simply click on the admin view name; this will open the admin view and if you have permission it will give you access to edit the values of an admin view. Edit State You can publish, unpublish, archive, and trash any admin view by clicking in the boxes next the admin view names and then click on the corresponding button of the task you want to perform. This will change the state of all the admin views you’ve selected.
If you have trashed an admin view it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed admin views. To completely remove these admin views from your system do the following: first select all the admin views you want to permanently delete by clicking in the boxes next to the admin view names and then click on the Empty trash button in the toolbar. This will permanently delete the admin views from the database. On the other hand if you would like to change the status of the admin view to publish, unpublish or archive, click in the boxes next to the admin view names and then click on the corresponding button of the task you want to perform. This will change the state of all the admin views you’ve selected.
Check-in When another user on your Joomla website opens an admin view the system checks the admin view out to that user. A little lock will show up next to the admin view name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the admin views that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the admin view names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the admin view, which will mean that it removes the admin view from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many admin views at once by clicking in the boxes next the admin view names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the admin views according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of admin views. With them you can update and create many admin views at once.
Export The export option only exports the admin views selected. So to export all admin views you must change the limited number of admin views that are being loaded to \"All\". The box that limits the number of admin views being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the admin view records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the admin views. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create admin views or update existing admin views. The way to update existing admin views is to use the same id as the admin view you want to update. Best way to do this is to first export the admin views you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new admin views via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of admin views and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of admin views with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Admin Views', 2, '', '', 1, 5, 0, 2),
+(3, 'custom_admin_views', 'welcome-to-the-list-view-of-custom-admin-views', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a custom admin view by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new custom admin view.
Edit You can edit custom admin views in two ways.
You can click on the box next to the custom admin view name and then click on the Edit button in the toolbar; this will open the custom admin view and if you have permission it will give you access to edit the values of a custom admin view. You can simply click on the custom admin view name; this will open the custom admin view and if you have permission it will give you access to edit the values of a custom admin view. Edit State You can publish, unpublish, archive, and trash any custom admin view by clicking in the boxes next the custom admin view names and then click on the corresponding button of the task you want to perform. This will change the state of all the custom admin views you’ve selected.
If you have trashed a custom admin view it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed custom admin views. To completely remove these custom admin views from your system do the following: first select all the custom admin views you want to permanently delete by clicking in the boxes next to the custom admin view names and then click on the Empty trash button in the toolbar. This will permanently delete the custom admin views from the database. On the other hand if you would like to change the status of the custom admin view to publish, unpublish or archive, click in the boxes next to the custom admin view names and then click on the corresponding button of the task you want to perform. This will change the state of all the custom admin views you’ve selected.
Check-in When another user on your Joomla website opens a custom admin view the system checks the custom admin view out to that user. A little lock will show up next to the custom admin view name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the custom admin views that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the custom admin view names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the custom admin view, which will mean that it removes the custom admin view from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many custom admin views at once by clicking in the boxes next the custom admin view names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the custom admin views according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of custom admin views. With them you can update and create many custom admin views at once.
Export The export option only exports the custom admin views selected. So to export all custom admin views you must change the limited number of custom admin views that are being loaded to \"All\". The box that limits the number of custom admin views being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the custom admin view records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the custom admin views. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create custom admin views or update existing custom admin views. The way to update existing custom admin views is to use the same id as the custom admin view you want to update. Best way to do this is to first export the custom admin views you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new custom admin views via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of custom admin views and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of custom admin views with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Custom Admin Views', 2, '', '', 1, 4, 0, 3),
+(4, 'site_views', 'welcome-to-the-list-view-of-site-views', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a site view by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new site view.
Edit You can edit site views in two ways.
You can click on the box next to the site view name and then click on the Edit button in the toolbar; this will open the site view and if you have permission it will give you access to edit the values of a site view. You can simply click on the site view name; this will open the site view and if you have permission it will give you access to edit the values of a site view. Edit State You can publish, unpublish, archive, and trash any site view by clicking in the boxes next the site view names and then click on the corresponding button of the task you want to perform. This will change the state of all the site views you’ve selected.
If you have trashed a site view it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed site views. To completely remove these site views from your system do the following: first select all the site views you want to permanently delete by clicking in the boxes next to the site view names and then click on the Empty trash button in the toolbar. This will permanently delete the site views from the database. On the other hand if you would like to change the status of the site view to publish, unpublish or archive, click in the boxes next to the site view names and then click on the corresponding button of the task you want to perform. This will change the state of all the site views you’ve selected.
Check-in When another user on your Joomla website opens a site view the system checks the site view out to that user. A little lock will show up next to the site view name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the site views that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the site view names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the site view, which will mean that it removes the site view from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many site views at once by clicking in the boxes next the site view names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the site views according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of site views. With them you can update and create many site views at once.
Export The export option only exports the site views selected. So to export all site views you must change the limited number of site views that are being loaded to \"All\". The box that limits the number of site views being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the site view records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the site views. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create site views or update existing site views. The way to update existing site views is to use the same id as the site view you want to update. Best way to do this is to first export the site views you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new site views via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of site views and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of site views with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Site Views', 2, '', '', 1, 3, 0, 4),
+(5, 'templates', 'welcome-to-the-list-view-of-templates', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a template by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new template.
Edit You can edit templates in two ways.
You can click on the box next to the template name and then click on the Edit button in the toolbar; this will open the template and if you have permission it will give you access to edit the values of a template. You can simply click on the template name; this will open the template and if you have permission it will give you access to edit the values of a template. Edit State You can publish, unpublish, archive, and trash any template by clicking in the boxes next the template names and then click on the corresponding button of the task you want to perform. This will change the state of all the templates you’ve selected.
If you have trashed a template it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed templates. To completely remove these templates from your system do the following: first select all the templates you want to permanently delete by clicking in the boxes next to the template names and then click on the Empty trash button in the toolbar. This will permanently delete the templates from the database. On the other hand if you would like to change the status of the template to publish, unpublish or archive, click in the boxes next to the template names and then click on the corresponding button of the task you want to perform. This will change the state of all the templates you’ve selected.
Check-in When another user on your Joomla website opens a template the system checks the template out to that user. A little lock will show up next to the template name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the templates that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the template names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the template, which will mean that it removes the template from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many templates at once by clicking in the boxes next the template names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the templates according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of templates. With them you can update and create many templates at once.
Export The export option only exports the templates selected. So to export all templates you must change the limited number of templates that are being loaded to \"All\". The box that limits the number of templates being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the template records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the templates. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create templates or update existing templates. The way to update existing templates is to use the same id as the template you want to update. Best way to do this is to first export the templates you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new templates via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of templates and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of templates with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Templates', 2, '', '', 1, 4, 0, 5),
+(6, 'layouts', 'welcome-to-the-list-view-of-layouts', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a layout by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new layout.
Edit You can edit layouts in two ways.
You can click on the box next to the layout name and then click on the Edit button in the toolbar; this will open the layout and if you have permission it will give you access to edit the values of a layout. You can simply click on the layout name; this will open the layout and if you have permission it will give you access to edit the values of a layout. Edit State You can publish, unpublish, archive, and trash any layout by clicking in the boxes next the layout names and then click on the corresponding button of the task you want to perform. This will change the state of all the layouts you’ve selected.
If you have trashed a layout it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed layouts. To completely remove these layouts from your system do the following: first select all the layouts you want to permanently delete by clicking in the boxes next to the layout names and then click on the Empty trash button in the toolbar. This will permanently delete the layouts from the database. On the other hand if you would like to change the status of the layout to publish, unpublish or archive, click in the boxes next to the layout names and then click on the corresponding button of the task you want to perform. This will change the state of all the layouts you’ve selected.
Check-in When another user on your Joomla website opens a layout the system checks the layout out to that user. A little lock will show up next to the layout name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the layouts that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the layout names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the layout, which will mean that it removes the layout from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many layouts at once by clicking in the boxes next the layout names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the layouts according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of layouts. With them you can update and create many layouts at once.
Export The export option only exports the layouts selected. So to export all layouts you must change the limited number of layouts that are being loaded to \"All\". The box that limits the number of layouts being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the layout records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the layouts. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create layouts or update existing layouts. The way to update existing layouts is to use the same id as the layout you want to update. Best way to do this is to first export the layouts you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new layouts via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of layouts and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of layouts with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Layouts', 2, '', '', 1, 3, 0, 6),
+(7, 'dynamic_gets', 'welcome-to-the-list-view-of-dynamic-gets', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a dynamic get by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new dynamic get.
Edit You can edit dynamic gets in two ways.
You can click on the box next to the dynamic get name and then click on the Edit button in the toolbar; this will open the dynamic get and if you have permission it will give you access to edit the values of a dynamic get. You can simply click on the dynamic get name; this will open the dynamic get and if you have permission it will give you access to edit the values of a dynamic get. Edit State You can publish, unpublish, archive, and trash any dynamic get by clicking in the boxes next the dynamic get names and then click on the corresponding button of the task you want to perform. This will change the state of all the dynamic gets you’ve selected.
If you have trashed a dynamic get it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed dynamic gets. To completely remove these dynamic gets from your system do the following: first select all the dynamic gets you want to permanently delete by clicking in the boxes next to the dynamic get names and then click on the Empty trash button in the toolbar. This will permanently delete the dynamic gets from the database. On the other hand if you would like to change the status of the dynamic get to publish, unpublish or archive, click in the boxes next to the dynamic get names and then click on the corresponding button of the task you want to perform. This will change the state of all the dynamic gets you’ve selected.
Check-in When another user on your Joomla website opens a dynamic get the system checks the dynamic get out to that user. A little lock will show up next to the dynamic get name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the dynamic gets that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the dynamic get names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the dynamic get, which will mean that it removes the dynamic get from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many dynamic gets at once by clicking in the boxes next the dynamic get names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the dynamic gets according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of dynamic gets. With them you can update and create many dynamic gets at once.
Export The export option only exports the dynamic gets selected. So to export all dynamic gets you must change the limited number of dynamic gets that are being loaded to \"All\". The box that limits the number of dynamic gets being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the dynamic get records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the dynamic gets. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create dynamic gets or update existing dynamic gets. The way to update existing dynamic gets is to use the same id as the dynamic get you want to update. Best way to do this is to first export the dynamic gets you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new dynamic gets via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of dynamic gets and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of dynamic gets with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Dynamic Gets', 2, '', '', 1, 3, 0, 7),
+(8, 'snippets', 'welcome-to-the-list-view-of-snippets', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a snippet by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new snippet.
Edit You can edit snippets in two ways.
You can click on the box next to the snippet name and then click on the Edit button in the toolbar; this will open the snippet and if you have permission it will give you access to edit the values of a snippet. You can simply click on the snippet name; this will open the snippet and if you have permission it will give you access to edit the values of a snippet. Edit State You can publish, unpublish, archive, and trash any snippet by clicking in the boxes next the snippet names and then click on the corresponding button of the task you want to perform. This will change the state of all the snippets you’ve selected.
If you have trashed a snippet it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed snippets. To completely remove these snippets from your system do the following: first select all the snippets you want to permanently delete by clicking in the boxes next to the snippet names and then click on the Empty trash button in the toolbar. This will permanently delete the snippets from the database. On the other hand if you would like to change the status of the snippet to publish, unpublish or archive, click in the boxes next to the snippet names and then click on the corresponding button of the task you want to perform. This will change the state of all the snippets you’ve selected.
Check-in When another user on your Joomla website opens a snippet the system checks the snippet out to that user. A little lock will show up next to the snippet name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the snippets that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the snippet names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the snippet, which will mean that it removes the snippet from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many snippets at once by clicking in the boxes next the snippet names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the snippets according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of snippets. With them you can update and create many snippets at once.
Export The export option only exports the snippets selected. So to export all snippets you must change the limited number of snippets that are being loaded to \"All\". The box that limits the number of snippets being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the snippet records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the snippets. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create snippets or update existing snippets. The way to update existing snippets is to use the same id as the snippet you want to update. Best way to do this is to first export the snippets you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new snippets via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of snippets and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of snippets with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Snippets', 2, '', '', 1, 3, 0, 8),
+(9, 'fields', 'welcome-to-the-list-view-of-fields', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a field by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new field.
Edit You can edit fields in two ways.
You can click on the box next to the field name and then click on the Edit button in the toolbar; this will open the field and if you have permission it will give you access to edit the values of a field. You can simply click on the field name; this will open the field and if you have permission it will give you access to edit the values of a field. Edit State You can publish, unpublish, archive, and trash any field by clicking in the boxes next the field names and then click on the corresponding button of the task you want to perform. This will change the state of all the fields you’ve selected.
If you have trashed a field it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed fields. To completely remove these fields from your system do the following: first select all the fields you want to permanently delete by clicking in the boxes next to the field names and then click on the Empty trash button in the toolbar. This will permanently delete the fields from the database. On the other hand if you would like to change the status of the field to publish, unpublish or archive, click in the boxes next to the field names and then click on the corresponding button of the task you want to perform. This will change the state of all the fields you’ve selected.
Check-in When another user on your Joomla website opens a field the system checks the field out to that user. A little lock will show up next to the field name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the fields that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the field names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the field, which will mean that it removes the field from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many fields at once by clicking in the boxes next the field names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the fields according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of fields. With them you can update and create many fields at once.
Export The export option only exports the fields selected. So to export all fields you must change the limited number of fields that are being loaded to \"All\". The box that limits the number of fields being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the field records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the fields. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create fields or update existing fields. The way to update existing fields is to use the same id as the field you want to update. Best way to do this is to first export the fields you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new fields via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of fields and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of fields with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Fields', 2, '', '', 1, 3, 0, 9),
+(10, 'fieldtypes', 'welcome-to-the-list-view-of-fieldtypes', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a fieldtype by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new fieldtype.
Edit You can edit fieldtypes in two ways.
You can click on the box next to the fieldtype name and then click on the Edit button in the toolbar; this will open the fieldtype and if you have permission it will give you access to edit the values of a fieldtype. You can simply click on the fieldtype name; this will open the fieldtype and if you have permission it will give you access to edit the values of a fieldtype. Edit State You can publish, unpublish, archive, and trash any fieldtype by clicking in the boxes next the fieldtype names and then click on the corresponding button of the task you want to perform. This will change the state of all the fieldtypes you’ve selected.
If you have trashed a fieldtype it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed fieldtypes. To completely remove these fieldtypes from your system do the following: first select all the fieldtypes you want to permanently delete by clicking in the boxes next to the fieldtype names and then click on the Empty trash button in the toolbar. This will permanently delete the fieldtypes from the database. On the other hand if you would like to change the status of the fieldtype to publish, unpublish or archive, click in the boxes next to the fieldtype names and then click on the corresponding button of the task you want to perform. This will change the state of all the fieldtypes you’ve selected.
Check-in When another user on your Joomla website opens a fieldtype the system checks the fieldtype out to that user. A little lock will show up next to the fieldtype name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the fieldtypes that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the fieldtype names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the fieldtype, which will mean that it removes the fieldtype from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many fieldtypes at once by clicking in the boxes next the fieldtype names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the fieldtypes according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of fieldtypes. With them you can update and create many fieldtypes at once.
Export The export option only exports the fieldtypes selected. So to export all fieldtypes you must change the limited number of fieldtypes that are being loaded to \"All\". The box that limits the number of fieldtypes being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the fieldtype records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the fieldtypes. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create fieldtypes or update existing fieldtypes. The way to update existing fieldtypes is to use the same id as the fieldtype you want to update. Best way to do this is to first export the fieldtypes you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new fieldtypes via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of fieldtypes and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of fieldtypes with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Fieldtypes', 2, '', '', 1, 3, 0, 10),
+(11, 'help_documents', 'welcome-to-the-list-view-of-help-documents', 0, '
Here as in all Joomla backend list views you can perform all the common tasks, and more.
Create You can create a help document by clicking on the New button in the toolbar, this will open a window where you can add all the needed values to create a new help document.
Edit You can edit help documents in two ways.
You can click on the box next to the help document name and then click on the Edit button in the toolbar; this will open the help document and if you have permission it will give you access to edit the values of a help document. You can simply click on the help document name; this will open the help document and if you have permission it will give you access to edit the values of a help document. Edit State You can publish, unpublish, archive, and trash any help document by clicking in the boxes next the help document names and then click on the corresponding button of the task you want to perform. This will change the state of all the help documents you’ve selected.
If you have trashed a help document it is in the trash and can still be found in the database. To view items that are still in the trash change the “- Select Status –“ filter to Trashed. Here you will see the list of trashed help documents. To completely remove these help documents from your system do the following: first select all the help documents you want to permanently delete by clicking in the boxes next to the help document names and then click on the Empty trash button in the toolbar. This will permanently delete the help documents from the database. On the other hand if you would like to change the status of the help document to publish, unpublish or archive, click in the boxes next to the help document names and then click on the corresponding button of the task you want to perform. This will change the state of all the help documents you’ve selected.
Check-in When another user on your Joomla website opens a help document the system checks the help document out to that user. A little lock will show up next to the help document name. When you hover over the lock it will show to you who checked it out and when.
Component builder adds a nice feature to all its components that is called the auto check-in feature. This feature has a time setting that you can update in the component\'s global settings.
If this feature has not yet checked-in any of the help documents that you as the administrator wants to open you can force a check-in by clicking in the boxes next to the help document names and then click on the Check-in button in the toolbar, or simply click on the little lock. This will then check in the help document, which will mean that it removes the help document from the user who checked it out before you. Remember that they will lose all changes they have made if they have not yet clicked save. This can cause very unpleasant circumstances, so only use this feature if you are absolutely sure you know what you are doing.
Batch Feature You can use the Batch feature to update or copy many help documents at once by clicking in the boxes next the help document names and then click on the Batch button in the toolbar. This will open a popup window with multiple dropdown options of fields you can change with the batch feature. You can then select update or copy depending of your desired task and finally click on the Process button. Once completed this batch feature will have either copied or updated all the help documents according to the task you selected.
Export & Import The export and import feature is some of the most exciting features to the list view of help documents. With them you can update and create many help documents at once.
Export The export option only exports the help documents selected. So to export all help documents you must change the limited number of help documents that are being loaded to \"All\". The box that limits the number of help documents being loaded is found on the right top corner of the page. Simply change it from the number to “All” and the page should now reload with all the help document records from the database, excluding those in trash. If you want those also to load you must change the “- Select Status –“ filter to “All” as well. Now you can click on the tick box at the very top of the table. This should select all the help documents. Next click on the Export Date button in the toolbar. This should open a download window and you can select to save the excel file to your computer.
Import The import option can be used to create help documents or update existing help documents. The way to update existing help documents is to use the same id as the help document you want to update. Best way to do this is to first export the help documents you want to update and then make the changes you have in mind in the excel document without removing or changing the id. To instead create new help documents via an import, simple leave the id field empty.
So once you have your excel document ready you will again open the list view of help documents and click on the Import Data button in the toolbar. This will open a page where you can select the excel file on your computer as an upload, or on the server in a directory, or at any direct url to the excel document.
Once you have the file selected you can click on the Upload File or Get File button depending on the method you have chosen. When file has successfully been uploaded or retrieved a new window will open where you can map the excel document headers of each column to the field names used in the database. Usually if you’re using an exported version of the excel document this mapping will be done for you, yet if you have changed any of the header names you may need to set these field relationships manually. There is an option to ignore a column in the case when you want to leave a field totally unchanged.
When the field to column relationship has correctly been mapped you can click on the continue button at the bottom of the page. This should return you to the list view of help documents with a success message.
Debug In the event that any of the above features did not work as expected, please read the error message carefully since it should usually give you enough information to why your request could not be processed. Subsequently if you are still not able to perform the request after making all needed corrections according to the error messages, then please contact your system administrator.
', '\"\"', 1, '', 2, 'Welcome to the List view of Help Documents', 2, '', '', 1, 3, 0, 11);
--
-- Dumping data for table `#__componentbuilder_admin_fields`
--
-
INSERT INTO `#__componentbuilder_admin_fields` (`id`, `addfields`, `admin_view`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(111, '{\"0\":{\"field\":\"d763ecd7-8d72-418e-8010-706c0785baab\",\"list\":\"2\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"1\"},\"1\":{\"field\":\"749a9917-90c3-49c4-9e72-aa33b0683a87\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"2\"},\"2\":{\"field\":\"5d3d34dd-4876-4c6a-86ab-b4e162f22c08\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"3\":{\"field\":\"335866ce-b81b-4329-901d-c20254135c9c\",\"list\":\"\",\"order_list\":\"0\",\"alias\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"4\":{\"field\":\"2a877e46-59b9-4f97-9dec-8c84c16741f2\",\"list\":\"2\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"2\",\"alignment\":3,\"order_edit\":\"1\"},\"5\":{\"field\":\"47a3db14-de87-4cc2-8724-17f437a77d93\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"2\",\"alignment\":3,\"order_edit\":\"2\"},\"6\":{\"field\":\"639e63b1-a63d-4d40-853f-42e7b28a5d35\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"2\",\"alignment\":3,\"order_edit\":\"3\"},\"7\":{\"field\":\"c61285fd-2e35-4605-869f-66d2fbd70004\",\"list\":\"2\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"3\",\"alignment\":1,\"order_edit\":\"1\"},\"8\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', 'c1053952-8a84-4398-aef1-41726f7c0043', 1, '2017-10-12 19:52:03', '2024-09-19 21:58:06', 21, '', '', ''),
-(282, '{\"0\":{\"field\":\"9f6f776f-9741-4aec-a3ff-fb9880fdcb5c\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"1\"},\"1\":{\"field\":\"523f91f8-ca60-44f7-9de0-645549967095\",\"list\":\"1\",\"order_list\":\"3\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"2\"},\"2\":{\"field\":\"794ac8d4-c78b-4f98-9953-07e4ce5ad491\",\"list\":\"1\",\"order_list\":\"4\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"3\"},\"3\":{\"field\":\"6b3c73d5-7640-43c0-a2e7-125a187f4513\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"1\"},\"4\":{\"field\":\"fd936809-37c1-4016-a4ee-a4d016343725\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"2\"},\"5\":{\"field\":\"24f17aaf-cc19-4bad-bc8b-4d37c79a898d\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"3\"},\"6\":{\"field\":\"ca8f38cb-f930-4976-a76b-c1d6cd18652d\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"4\"},\"7\":{\"field\":\"6f327030-dcdf-4d80-b3d9-293d4bbe39f7\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"5\"},\"8\":{\"field\":\"5d3d34dd-4876-4c6a-86ab-b4e162f22c08\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"9\":{\"field\":\"e24026ef-294a-48e5-9be0-3f95dcb2b66b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"10\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', '19a973ea-cdfa-4c79-bbbd-1b8a37286b27', 1, '2024-09-06 22:03:19', '2024-09-16 23:49:09', 11, '', 43, ''),
-(283, '{\"0\":{\"field\":\"976f7e2d-68e3-497e-b4d1-6326d5b95078\",\"list\":\"1\",\"order_list\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"1\"},\"1\":{\"field\":\"f40974bd-a946-4bc4-9be1-fedec2d09c24\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"2\"},\"2\":{\"field\":\"c8cc2a22-f2e4-4dcc-9088-ed1d78416228\",\"list\":\"1\",\"order_list\":\"3\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"3\"},\"3\":{\"field\":\"6c3a6983-d1bf-4e5e-9e99-deea00b0cefd\",\"list\":\"\",\"order_list\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"2\"},\"4\":{\"field\":\"2e24a9fe-5793-46be-b071-631c0b18d8f4\",\"list\":\"1\",\"order_list\":\"4\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"5\":{\"field\":\"3f1fedeb-b943-42a7-88e7-c4f1eb1fd8a4\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"6\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', '595ba2c9-21fa-43a4-9af7-93c9cfb21b82', 1, '2024-09-06 22:15:55', '2024-09-16 23:32:35', 5, '', 44, ''),
-(284, '{\"0\":{\"field\":\"725e856a-b8cc-4590-90e3-3eed6fd0873c\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"1\"},\"1\":{\"field\":\"77a1711b-ad1f-4379-921b-5e4ef5c31a42\",\"list\":\"1\",\"order_list\":\"3\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"2\"},\"2\":{\"field\":\"68c1e141-fb2e-49a6-bf56-1da6d8a058e8\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"3\"},\"3\":{\"field\":\"c2f884f9-31a0-4bb9-8310-64b5d9132d32\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"1\"},\"4\":{\"field\":\"080b92dc-a4b4-46b2-83d4-3430284f5e06\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"2\"},\"5\":{\"field\":\"ed28e30c-30c3-4830-afdc-5a61bf25cd49\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"3\"},\"6\":{\"field\":\"2e24a9fe-5793-46be-b071-631c0b18d8f4\",\"list\":\"1\",\"order_list\":\"4\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"7\":{\"field\":\"3f1fedeb-b943-42a7-88e7-c4f1eb1fd8a4\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"8\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', '224eb9c7-8b40-48cf-bf77-2afa291fd54a', 1, '2024-09-06 22:48:18', '2024-09-17 22:00:38', 9, '', 45, ''),
-(285, '{\"0\":{\"field\":\"3dfab308-41de-4d11-9c94-4ba330a202ac\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"1\"},\"1\":{\"field\":\"2e24a9fe-5793-46be-b071-631c0b18d8f4\",\"list\":\"\",\"order_list\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"2\":{\"field\":\"3f1fedeb-b943-42a7-88e7-c4f1eb1fd8a4\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"3\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', '60b7b30d-9229-4ce2-b055-9efbb7ac4cea', 1, '2024-09-06 22:53:19', '0000-00-00 00:00:00', 1, '', 46, ''),
-(288, '{\"0\":{\"field\":\"c6e1e451-99b8-4e1b-aa19-c48c3513bf4f\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"0\",\"permission\":[\"1\",\"2\",\"3\"]},\"1\":{\"field\":\"2e24a9fe-5793-46be-b071-631c0b18d8f4\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\",\"permission\":[\"1\",\"2\",\"3\"]},\"2\":{\"field\":\"3f1fedeb-b943-42a7-88e7-c4f1eb1fd8a4\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\",\"permission\":[\"3\"]},\"3\":{\"field\":\"0f4fa86e-25a8-4bbf-91a3-7ea9790b4df8\",\"list\":\"1\",\"order_list\":\"2\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"3\",\"permission\":[\"1\",\"2\",\"3\"]},\"4\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\",\"permission\":[\"3\"]}}', 'ab2bbdfc-c0a0-4ffc-9556-67d5af8bec64', 1, '2025-02-16 17:37:08', '', 1, '', 48, ''),
-(289, '{\"0\":{\"field\":\"2d0566ab-cfbe-4ca2-8d05-8e2c70eda191\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"2\",\"permission\":[\"1\",\"2\",\"3\"]},\"1\":{\"field\":\"91939b1a-c4d6-4531-8356-63bc4ca243fb\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\",\"permission\":[\"1\",\"2\",\"3\"]},\"2\":{\"field\":\"11698dc6-8ff6-4662-b3b7-e47494463a08\",\"list\":\"1\",\"order_list\":\"2\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\",\"permission\":[\"1\",\"2\",\"3\"]},\"3\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\",\"permission\":[\"3\"]}}', 'a9f19a16-fadb-44ea-a9b6-41130aad05ec', 1, '2025-02-16 19:16:27', '2025-02-16 19:16:59', 2, '', 49, '');
+(111, '{\"0\":{\"field\":\"d763ecd7-8d72-418e-8010-706c0785baab\",\"list\":\"2\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"1\"},\"1\":{\"field\":\"749a9917-90c3-49c4-9e72-aa33b0683a87\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"2\"},\"2\":{\"field\":\"5d3d34dd-4876-4c6a-86ab-b4e162f22c08\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"3\":{\"field\":\"335866ce-b81b-4329-901d-c20254135c9c\",\"list\":\"\",\"order_list\":\"0\",\"alias\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"4\":{\"field\":\"2a877e46-59b9-4f97-9dec-8c84c16741f2\",\"list\":\"2\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"2\",\"alignment\":3,\"order_edit\":\"1\"},\"5\":{\"field\":\"47a3db14-de87-4cc2-8724-17f437a77d93\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"2\",\"alignment\":3,\"order_edit\":\"2\"},\"6\":{\"field\":\"639e63b1-a63d-4d40-853f-42e7b28a5d35\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"2\",\"alignment\":3,\"order_edit\":\"3\"},\"7\":{\"field\":\"c61285fd-2e35-4605-869f-66d2fbd70004\",\"list\":\"2\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"3\",\"alignment\":1,\"order_edit\":\"1\"},\"8\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', 'c1053952-8a84-4398-aef1-41726f7c0043', 1, '2017-10-12 19:52:03', '2024-09-19 21:58:06', 21, 0, 0, ''),
+(282, '{\"0\":{\"field\":\"9f6f776f-9741-4aec-a3ff-fb9880fdcb5c\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"1\"},\"1\":{\"field\":\"523f91f8-ca60-44f7-9de0-645549967095\",\"list\":\"1\",\"order_list\":\"3\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"2\"},\"2\":{\"field\":\"794ac8d4-c78b-4f98-9953-07e4ce5ad491\",\"list\":\"1\",\"order_list\":\"4\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"3\"},\"3\":{\"field\":\"6b3c73d5-7640-43c0-a2e7-125a187f4513\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"1\"},\"4\":{\"field\":\"fd936809-37c1-4016-a4ee-a4d016343725\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"2\"},\"5\":{\"field\":\"24f17aaf-cc19-4bad-bc8b-4d37c79a898d\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"3\"},\"6\":{\"field\":\"ca8f38cb-f930-4976-a76b-c1d6cd18652d\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"4\"},\"7\":{\"field\":\"6f327030-dcdf-4d80-b3d9-293d4bbe39f7\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"5\"},\"8\":{\"field\":\"5d3d34dd-4876-4c6a-86ab-b4e162f22c08\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"9\":{\"field\":\"e24026ef-294a-48e5-9be0-3f95dcb2b66b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"10\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', '19a973ea-cdfa-4c79-bbbd-1b8a37286b27', 1, '2024-09-06 22:03:19', '2024-09-16 23:49:09', 11, 0, 43, NULL),
+(283, '{\"0\":{\"field\":\"976f7e2d-68e3-497e-b4d1-6326d5b95078\",\"list\":\"1\",\"order_list\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"1\"},\"1\":{\"field\":\"f40974bd-a946-4bc4-9be1-fedec2d09c24\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"2\"},\"2\":{\"field\":\"c8cc2a22-f2e4-4dcc-9088-ed1d78416228\",\"list\":\"1\",\"order_list\":\"3\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"3\"},\"3\":{\"field\":\"6c3a6983-d1bf-4e5e-9e99-deea00b0cefd\",\"list\":\"\",\"order_list\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"2\"},\"4\":{\"field\":\"2e24a9fe-5793-46be-b071-631c0b18d8f4\",\"list\":\"1\",\"order_list\":\"4\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"5\":{\"field\":\"3f1fedeb-b943-42a7-88e7-c4f1eb1fd8a4\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"6\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', '595ba2c9-21fa-43a4-9af7-93c9cfb21b82', 1, '2024-09-06 22:15:55', '2024-09-16 23:32:35', 5, 0, 44, NULL),
+(284, '{\"0\":{\"field\":\"725e856a-b8cc-4590-90e3-3eed6fd0873c\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"1\"},\"1\":{\"field\":\"77a1711b-ad1f-4379-921b-5e4ef5c31a42\",\"list\":\"1\",\"order_list\":\"3\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"2\"},\"2\":{\"field\":\"68c1e141-fb2e-49a6-bf56-1da6d8a058e8\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"3\"},\"3\":{\"field\":\"c2f884f9-31a0-4bb9-8310-64b5d9132d32\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"1\"},\"4\":{\"field\":\"080b92dc-a4b4-46b2-83d4-3430284f5e06\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"2\"},\"5\":{\"field\":\"ed28e30c-30c3-4830-afdc-5a61bf25cd49\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":2,\"order_edit\":\"3\"},\"6\":{\"field\":\"2e24a9fe-5793-46be-b071-631c0b18d8f4\",\"list\":\"1\",\"order_list\":\"4\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"7\":{\"field\":\"3f1fedeb-b943-42a7-88e7-c4f1eb1fd8a4\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"8\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', '224eb9c7-8b40-48cf-bf77-2afa291fd54a', 1, '2024-09-06 22:48:18', '2024-09-17 22:00:38', 9, 0, 45, NULL),
+(285, '{\"0\":{\"field\":\"3dfab308-41de-4d11-9c94-4ba330a202ac\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":1,\"order_edit\":\"1\"},\"1\":{\"field\":\"2e24a9fe-5793-46be-b071-631c0b18d8f4\",\"list\":\"\",\"order_list\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\"},\"2\":{\"field\":\"3f1fedeb-b943-42a7-88e7-c4f1eb1fd8a4\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\"},\"3\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\"}}', '60b7b30d-9229-4ce2-b055-9efbb7ac4cea', 1, '2024-09-06 22:53:19', '0000-00-00 00:00:00', 1, 0, 46, NULL),
+(288, '{\"0\":{\"field\":\"c6e1e451-99b8-4e1b-aa19-c48c3513bf4f\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"0\",\"permission\":[\"1\",\"2\",\"3\"]},\"1\":{\"field\":\"2e24a9fe-5793-46be-b071-631c0b18d8f4\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\",\"permission\":[\"1\",\"2\",\"3\"]},\"2\":{\"field\":\"3f1fedeb-b943-42a7-88e7-c4f1eb1fd8a4\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\",\"permission\":[\"3\"]},\"3\":{\"field\":\"0f4fa86e-25a8-4bbf-91a3-7ea9790b4df8\",\"list\":\"1\",\"order_list\":\"2\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"3\",\"permission\":[\"1\",\"2\",\"3\"]},\"4\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\",\"permission\":[\"3\"]}}', 'ab2bbdfc-c0a0-4ffc-9556-67d5af8bec64', 1, '2025-02-16 17:37:08', NULL, 1, 0, 48, NULL),
+(289, '{\"0\":{\"field\":\"2d0566ab-cfbe-4ca2-8d05-8e2c70eda191\",\"list\":\"\",\"order_list\":\"0\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":3,\"order_edit\":\"2\",\"permission\":[\"1\",\"2\",\"3\"]},\"1\":{\"field\":\"91939b1a-c4d6-4531-8356-63bc4ca243fb\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"1\",\"permission\":[\"1\",\"2\",\"3\"]},\"2\":{\"field\":\"11698dc6-8ff6-4662-b3b7-e47494463a08\",\"list\":\"1\",\"order_list\":\"2\",\"filter\":\"\",\"tab\":\"1\",\"alignment\":4,\"order_edit\":\"2\",\"permission\":[\"1\",\"2\",\"3\"]},\"3\":{\"field\":\"5aa57bbe-7b19-4db9-915c-561863458d2b\",\"list\":\"\",\"order_list\":\"0\",\"search\":\"1\",\"filter\":\"\",\"tab\":\"15\",\"alignment\":1,\"order_edit\":\"0\",\"permission\":[\"3\"]}}', 'a9f19a16-fadb-44ea-a9b6-41130aad05ec', 1, '2025-02-16 19:16:27', '2025-02-16 19:16:59', 2, 0, 49, NULL);
--
-- Dumping data for table `#__componentbuilder_component_admin_views`
--
-
INSERT INTO `#__componentbuilder_component_admin_views` (`id`, `addadmin_views`, `joomla_component`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(27, '{\"addadmin_views0\":{\"adminview\":\"c1053952-8a84-4398-aef1-41726f7c0043\",\"icomoon\":\"eye-open\",\"mainmenu\":\"1\",\"dashboard_add\":\"1\",\"dashboard_list\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"joomla_fields\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"2\",\"filter\":\"2\",\"edit_create_site_view\":\"1\",\"order\":\"1\"},\"addadmin_views1\":{\"adminview\":\"595ba2c9-21fa-43a4-9af7-93c9cfb21b82\",\"icomoon\":\"plus\",\"mainmenu\":\"1\",\"dashboard_list\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"2\"},\"addadmin_views2\":{\"adminview\":\"224eb9c7-8b40-48cf-bf77-2afa291fd54a\",\"icomoon\":\"file\",\"mainmenu\":\"1\",\"dashboard_list\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"3\"},\"addadmin_views3\":{\"adminview\":\"19a973ea-cdfa-4c79-bbbd-1b8a37286b27\",\"icomoon\":\"file-check\",\"mainmenu\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"4\"},\"addadmin_views4\":{\"adminview\":\"60b7b30d-9229-4ce2-b055-9efbb7ac4cea\",\"icomoon\":\"users\",\"mainmenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"5\"},\"addadmin_views5\":{\"adminview\":\"a9f19a16-fadb-44ea-a9b6-41130aad05ec\",\"icomoon\":\"upload\",\"mainmenu\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"6\"},\"addadmin_views6\":{\"adminview\":\"ab2bbdfc-c0a0-4ffc-9556-67d5af8bec64\",\"icomoon\":\"envelope\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"7\"}}', 'efde995e-60aa-4b39-b644-44349dfb660d', 1, '2017-10-28 03:56:26', '2025-02-19 09:21:34', 13, '', '', '');
+(84, '{\"addadmin_views0\":{\"adminview\":\"c1053952-8a84-4398-aef1-41726f7c0043\",\"icomoon\":\"eye-open\",\"mainmenu\":\"1\",\"dashboard_add\":\"1\",\"dashboard_list\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"joomla_fields\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"2\",\"filter\":\"2\",\"edit_create_site_view\":\"1\",\"order\":\"1\"},\"addadmin_views1\":{\"adminview\":\"595ba2c9-21fa-43a4-9af7-93c9cfb21b82\",\"icomoon\":\"plus\",\"mainmenu\":\"1\",\"dashboard_list\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"2\"},\"addadmin_views2\":{\"adminview\":\"224eb9c7-8b40-48cf-bf77-2afa291fd54a\",\"icomoon\":\"file\",\"mainmenu\":\"1\",\"dashboard_list\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"3\"},\"addadmin_views3\":{\"adminview\":\"19a973ea-cdfa-4c79-bbbd-1b8a37286b27\",\"icomoon\":\"file-check\",\"mainmenu\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"4\"},\"addadmin_views4\":{\"adminview\":\"60b7b30d-9229-4ce2-b055-9efbb7ac4cea\",\"icomoon\":\"users\",\"mainmenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"5\"},\"addadmin_views5\":{\"adminview\":\"a9f19a16-fadb-44ea-a9b6-41130aad05ec\",\"icomoon\":\"upload\",\"mainmenu\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"6\"},\"addadmin_views6\":{\"adminview\":\"ab2bbdfc-c0a0-4ffc-9556-67d5af8bec64\",\"icomoon\":\"envelope\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"access\":\"1\",\"add_api\":\"0\",\"filter\":\"2\",\"edit_create_site_view\":\"\",\"order\":\"7\"}}', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', 1, '2025-03-27 19:30:27', '2025-03-27 20:23:42', 4, 0, 14, NULL);
--
-- Dumping data for table `#__componentbuilder_component_site_views`
--
-
INSERT INTO `#__componentbuilder_component_site_views` (`id`, `addsite_views`, `joomla_component`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(27, '{\"addsite_views0\":{\"siteview\":\"b2dce59e-e3b8-4467-bcb5-8f2df4bdfeb7\",\"menu\":\"1\",\"metadata\":\"1\",\"default_view\":\"1\",\"access\":\"1\",\"public_access\":\"1\"},\"addsite_views1\":{\"siteview\":\"851ed44e-5431-4951-876f-4b62a4c56ad2\",\"metadata\":\"1\",\"access\":\"1\",\"public_access\":\"1\"}}', 'efde995e-60aa-4b39-b644-44349dfb660d', 1, '2017-10-28 03:56:26', '2025-02-19 09:17:41', 6, '', '', '');
+(80, '{\"addsite_views0\":{\"siteview\":\"b2dce59e-e3b8-4467-bcb5-8f2df4bdfeb7\",\"menu\":\"1\",\"metadata\":\"1\",\"default_view\":\"1\",\"access\":\"1\",\"public_access\":\"1\"},\"addsite_views1\":{\"siteview\":\"851ed44e-5431-4951-876f-4b62a4c56ad2\",\"metadata\":\"1\",\"access\":\"1\",\"public_access\":\"1\"}}', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', 1, '2025-03-27 19:30:27', '2025-02-19 09:17:41', 1, 0, 9, NULL);
--
-- Dumping data for table `#__componentbuilder_component_custom_admin_views`
--
-
INSERT INTO `#__componentbuilder_component_custom_admin_views` (`id`, `addcustom_admin_views`, `joomla_component`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(27, '{\"addcustom_admin_views0\":{\"customadminview\":\"917d2c1a-1b37-4ded-9ace-ef486fcc3e4d\",\"icomoon\":\"upload\",\"mainmenu\":\"1\",\"submenu\":\"1\",\"access\":\"1\",\"before\":\"595ba2c9-21fa-43a4-9af7-93c9cfb21b82\"}}', 'efde995e-60aa-4b39-b644-44349dfb660d', 1, '2017-10-28 03:56:26', '2025-02-19 09:41:44', 5, '', '', '');
+(78, '{\"addcustom_admin_views0\":{\"customadminview\":\"917d2c1a-1b37-4ded-9ace-ef486fcc3e4d\",\"icomoon\":\"upload\",\"mainmenu\":\"1\",\"submenu\":\"1\",\"access\":\"1\",\"before\":\"595ba2c9-21fa-43a4-9af7-93c9cfb21b82\"}}', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', 1, '2025-03-27 19:30:27', '2025-02-19 09:41:44', 1, 0, 8, NULL);
--
-- Dumping data for table `#__componentbuilder_component_updates`
--
-
INSERT INTO `#__componentbuilder_component_updates` (`id`, `joomla_component`, `version_update`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(27, 'efde995e-60aa-4b39-b644-44349dfb660d', '{\"version_update0\":{\"version\":\"5.0.1\",\"mysql\":\"\",\"url\":\"https:\\/\\/git.vdm.dev\\/joomla\\/Demo-Component\\/archive\\/v5.0.1.zip\",\"update_server_adv\":\"0\",\"update_server_type\":\"component\",\"update_element\":\"\",\"update_state\":\"stable\",\"update_target_version\":\"5\\\\.[012]\",\"change_log\":\"\",\"update_client\":\"site\"}}', 1, '2017-10-28 03:56:26', '2025-02-19 09:06:07', 14, '', '', '');
+(83, 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', '{\"version_update0\":{\"version\":\"4.0.1\",\"mysql\":\"\",\"url\":\"https:\\/\\/git.vdm.dev\\/joomla\\/Demo-Component\\/archive\\/v4.0.1.zip\",\"update_server_adv\":\"0\",\"update_server_type\":\"component\",\"update_element\":\"\",\"update_state\":\"stable\",\"update_target_version\":\"5\\\\.[012]\",\"change_log\":\"\",\"update_client\":\"site\"}}', 1, '2025-03-27 19:30:27', '2025-03-27 19:30:54', 2, 0, 12, NULL);
--
-- Dumping data for table `#__componentbuilder_component_mysql_tweaks`
--
-
INSERT INTO `#__componentbuilder_component_mysql_tweaks` (`id`, `joomla_component`, `sql_tweak`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(27, 'efde995e-60aa-4b39-b644-44349dfb660d', '{}', 1, '2017-10-28 03:56:26', '2024-09-07 03:00:20', 3, '', '', '');
+(78, 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', '{}', 1, '2025-03-27 19:30:27', '2024-09-07 03:00:20', 1, 0, 8, NULL);
--
-- Dumping data for table `#__componentbuilder_component_custom_admin_menus`
--
-
INSERT INTO `#__componentbuilder_component_custom_admin_menus` (`id`, `addcustommenus`, `joomla_component`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(27, '', 'efde995e-60aa-4b39-b644-44349dfb660d', 1, '2017-10-28 03:56:26', '0000-00-00 00:00:00', 2, '', '', '');
+(78, '', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', 1, '2025-03-27 19:30:27', '0000-00-00 00:00:00', 1, 0, 8, NULL);
--
-- Dumping data for table `#__componentbuilder_component_config`
--
-
INSERT INTO `#__componentbuilder_component_config` (`id`, `addconfig`, `joomla_component`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(27, '{\"addconfig0\":{\"field\":\"104f8410-a07e-4cf8-aad5-2b4db7c6864c\",\"custom_value\":\"\",\"tabname\":\"Group Selection\"}}', 'efde995e-60aa-4b39-b644-44349dfb660d', 1, '2017-10-28 03:56:26', '2024-09-07 02:39:56', 3, '', '', '');
+(79, '{\"addconfig0\":{\"field\":\"104f8410-a07e-4cf8-aad5-2b4db7c6864c\",\"custom_value\":\"\",\"tabname\":\"Group Selection\"}}', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', 1, '2025-03-27 19:30:27', '2024-09-07 02:39:56', 1, 0, 9, NULL);
--
-- Dumping data for table `#__componentbuilder_component_dashboard`
--
-
INSERT INTO `#__componentbuilder_component_dashboard` (`id`, `dashboard_tab`, `joomla_component`, `php_dashboard_methods`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `params`) VALUES
-(27, '', 'efde995e-60aa-4b39-b644-44349dfb660d', '', 1, '2017-10-28 03:56:26', '0000-00-00 00:00:00', 2, '', '', '');
+(81, '', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', '', 1, '2025-03-27 19:30:27', '0000-00-00 00:00:00', 1, 0, 10, NULL);
--
-- Dumping data for table `#__componentbuilder_component_files_folders`
--
-
INSERT INTO `#__componentbuilder_component_files_folders` (`id`, `addfiles`, `addfolders`, `joomla_component`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `addfilesfullpath`, `addfoldersfullpath`) VALUES
-(27, '{\"addfiles0\":{\"file\":\"DownloadControllerAdmin.php\",\"path\":\"admin\\/src\\/Controller\\/DownloadController.php\",\"notnew\":\"1\"},\"addfiles1\":{\"file\":\"DownloadControllerSite.php\",\"path\":\"site\\/src\\/Controller\\/DownloadController.php\",\"notnew\":\"1\"}}', '{}', 'efde995e-60aa-4b39-b644-44349dfb660d', '', 1, '2017-10-28 03:56:26', '2025-02-19 10:10:10', 7, '', '', '{}', '{\"addfoldersfullpath0\":{\"folderpath\":\"JPATH_LIBRARIES\\/phpspreadsheet\\/vendor\\/\",\"path\":\"\\/libraries\\/phpspreadsheet\\/\"}}');
+(80, '{\"addfiles0\":{\"file\":\"DownloadControllerAdmin.php\",\"path\":\"admin\\/src\\/Controller\\/DownloadController.php\",\"notnew\":\"1\"},\"addfiles1\":{\"file\":\"DownloadControllerSite.php\",\"path\":\"site\\/src\\/Controller\\/DownloadController.php\",\"notnew\":\"1\"}}', '{}', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', NULL, 1, '2025-03-27 19:30:27', '2025-02-19 10:10:10', 1, 0, 8, '{}', '{\"addfoldersfullpath0\":{\"folderpath\":\"JPATH_LIBRARIES\\/phpspreadsheet\\/vendor\\/\",\"path\":\"\\/libraries\\/phpspreadsheet\\/\"}}');
--
-- Dumping data for table `#__componentbuilder_component_placeholders`
--
-
INSERT INTO `#__componentbuilder_component_placeholders` (`id`, `addplaceholders`, `joomla_component`, `params`, `published`, `created`, `modified`) VALUES
-(43, '{\"addplaceholders0\":{\"target\":\"[[[upload_max_filesize]]]\",\"value\":\"7M\"},\"addplaceholders1\":{\"target\":\"[[[post_max_size]]]\",\"value\":\"6M\"},\"addplaceholders2\":{\"target\":\"[[[max_execution_time]]]\",\"value\":\"10\"},\"addplaceholders3\":{\"target\":\"[[[max_input_vars]]]\",\"value\":\"1000\"},\"addplaceholders4\":{\"target\":\"[[[max_input_time]]]\",\"value\":\"10\"},\"addplaceholders5\":{\"target\":\"[[[memory_limit]]]\",\"value\":\"16M\"},\"addplaceholders6\":{\"target\":\"[[[environment_wiki_url]]]\",\"value\":\"#\"},\"addplaceholders8\":{\"target\":\"[[[component_acronym]]]\",\"value\":\"DEMO\"},\"addplaceholders7\":{\"target\":\"[[[component_link_name]]]\",\"value\":\"default text\"}}', 'efde995e-60aa-4b39-b644-44349dfb660d', '', 1, '2024-07-27 13:02:05', '2024-09-16 03:25:05');
+(44, '{\"addplaceholders0\":{\"target\":\"[[[upload_max_filesize]]]\",\"value\":\"7M\"},\"addplaceholders1\":{\"target\":\"[[[post_max_size]]]\",\"value\":\"6M\"},\"addplaceholders2\":{\"target\":\"[[[max_execution_time]]]\",\"value\":\"10\"},\"addplaceholders3\":{\"target\":\"[[[max_input_vars]]]\",\"value\":\"1000\"},\"addplaceholders4\":{\"target\":\"[[[max_input_time]]]\",\"value\":\"10\"},\"addplaceholders5\":{\"target\":\"[[[memory_limit]]]\",\"value\":\"16M\"},\"addplaceholders6\":{\"target\":\"[[[environment_wiki_url]]]\",\"value\":\"#\"},\"addplaceholders8\":{\"target\":\"[[[component_acronym]]]\",\"value\":\"DEMO\"},\"addplaceholders7\":{\"target\":\"[[[component_link_name]]]\",\"value\":\"default text\"}}', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', NULL, 1, '2025-03-27 19:30:27', '2024-09-16 03:25:05');
--
-- Dumping data for table `#__componentbuilder_component_plugins`
--
-
INSERT INTO `#__componentbuilder_component_plugins` (`id`, `addjoomla_plugins`, `joomla_component`, `params`, `published`, `created`, `modified`, `version`, `hits`, `access`, `ordering`) VALUES
-(13, '{\"addjoomla_plugins0\":{\"plugin\":\"8aa96d76-94e3-47d1-8dd8-f430b72ed0f7\",\"target\":\"1\"},\"addjoomla_plugins1\":{\"plugin\":\"5df401b4-c9a6-42c8-b50d-87f67c8a15f3\",\"target\":\"1\"}}', 'efde995e-60aa-4b39-b644-44349dfb660d', '', 1, '2024-09-16 01:22:36', '2025-02-25 10:51:45', 7, '', 1, 13);
+(14, '{\"addjoomla_plugins0\":{\"plugin\":\"5df401b4-c9a6-42c8-b50d-87f67c8a15f3\",\"target\":\"1\"},\"addjoomla_plugins1\":{\"plugin\":\"8aa96d76-94e3-47d1-8dd8-f430b72ed0f7\",\"target\":\"1\"}}', 'd7d3bc04-6272-470a-91d1-e091ecb10ab6', NULL, 1, '2025-03-27 19:43:35', '2025-03-28 10:14:22', 4, 0, 1, 14);
--
-- Dumping data for table `#__componentbuilder_snippet_type`
--
-
INSERT INTO `#__componentbuilder_snippet_type` (`id`, `name`, `description`, `params`, `published`, `created`, `modified`, `version`, `hits`, `guid`, `ordering`) VALUES
-(1, 'Layout', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'bcb6bf0f-25ec-46ca-82dc-f5ee20a9ca0c', 1),
-(2, 'Navigations', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'a8868d62-50fa-49b0-bc57-b8c48bc314bf', 2),
-(3, 'Elements', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '53c39cb5-47ff-4b50-9c41-a7423f6d3d32', 3),
-(4, 'Common', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'f1da0bbe-2569-404f-b16d-54b71ad6174b', 4),
-(5, 'JavaScript', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'c845954f-c274-4235-bbb4-5d0f9a6bb6be', 5),
-(6, 'Charts', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '', 6),
-(7, 'Alerts', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '118327e9-ee52-493b-be69-9789cfd29ef6', 7),
-(8, 'Badges', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '44413b64-844a-433a-8486-2b073be99506', 8),
-(9, 'Breadcrumbs', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '1fd13c49-7747-4399-a5d9-c340100d3102', 9),
-(10, 'Buttons', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'c17d8819-f52a-44b7-a9bd-269fa105bde3', 10),
-(11, 'Button Groups', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '5618f845-d69b-408a-aa15-ef1162be8e7a', 11),
-(12, 'Button Modifiers', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'bea7ac19-aad5-4335-b190-b8828dc5d0c8', 12),
-(13, 'Cards', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'ac7a5719-231e-4b76-90fb-025e3a2fbdb2', 13),
-(14, 'Carousel', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '243298f7-02aa-47ad-a76c-3c19e41e3011', 14),
-(15, 'Collapse', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'c3c4ac8a-ab4a-4641-b4b7-018a190f25d5', 15),
-(16, 'Dropdowns', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '94ace410-b18d-4a04-a2c2-cfb532867145', 16),
-(17, 'Forms', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '15b018d4-0161-42ad-aa34-6ed242852da9', 17),
-(18, 'Form Input Groups', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '0f712af8-684e-4996-9920-c8ad60abea0a', 18),
-(19, 'Custom Forms', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'b101b15b-dbad-4884-bd22-bd4270f97b35', 19),
-(20, 'Grid', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '03cf9f8c-98ad-4fc2-9ac0-d4b94fb9f0a9', 20),
-(21, 'Images', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '1fa5a6e4-cf23-4343-84be-fc3b2a11d78e', 21),
-(22, 'Jumbotron', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '59b8fb82-3baa-448a-a35b-03615849c79e', 22),
-(23, 'List Group', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'b236f670-2139-4bb1-a4d5-d987d99bcd77', 23),
-(24, 'Media Objects', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '58b042c6-8758-465a-b4cf-adcf1b9a117b', 24),
-(25, 'Modal', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'dc9303fa-606e-4371-b635-78d974006597', 25),
-(26, 'Navs', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '598c50a1-5fa2-4d44-8dd1-dbf1bfb4c64a', 26),
-(27, 'Navbar', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'bdbbff94-2a74-4eb3-81ce-26068937e1c8', 27),
-(28, 'Pagination', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'bcf6a838-919a-4d56-bcf1-f3dab99737c9', 28),
-(29, 'Popover', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '3e5b282f-e964-4734-b97a-06677ded9ede', 29),
-(30, 'Progress', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '0fe0ad4d-99b3-4f68-bf6e-5c71a621d8c3', 30),
-(31, 'Scrollspy', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'fbc5cad8-91b4-4e3d-84a5-47e561319047', 31),
-(32, 'Tables', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'daa2ae4f-cc62-482a-be4c-f54589f1263a', 32),
-(33, 'Tooltips', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '6709de33-eff4-41b8-850d-c530a6cf6468', 33),
-(34, 'Typography', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '675a9b0b-31bf-4bb9-aab4-aef6e3cb0447', 34),
-(35, 'Utility: Borders', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '3e7e5183-0b6a-4c9d-8ff0-22ed8870e2e0', 35),
-(36, 'Utility: Colors', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'eaa09d56-f468-4bdf-b9f0-81d2a50c372e', 36),
-(37, 'Utility: Display', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', 'e0f4d5c6-8079-4165-8c8f-0d39abf990eb', 37),
-(38, 'Utility: Flexbox', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '3dfce6f8-f0c2-4f2c-8dc2-b61d86510438', 38),
-(39, 'Utility: Misc', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '9d168738-fe4f-4aa6-aee4-ef86f8ffab2c', 39),
-(40, 'Utility: Positioning', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '922f0ec3-9f37-41ba-9a07-4e5cd768dfa8', 40),
-(41, 'Utility: Sizing', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '9ec21d99-a329-49c8-b4f4-ed980a1b9fc4', 41),
-(42, 'Utility: Spacing', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '847c72f3-bd0d-4a64-8f03-194b31fd7975', 42),
-(43, 'Utility: Text', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, '', '15a3bf1f-468c-494b-8a54-2cd4ac7076d9', 43);
+(1, 'Layout', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'bcb6bf0f-25ec-46ca-82dc-f5ee20a9ca0c', 1),
+(2, 'Navigations', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'a8868d62-50fa-49b0-bc57-b8c48bc314bf', 2),
+(3, 'Elements', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '53c39cb5-47ff-4b50-9c41-a7423f6d3d32', 3),
+(4, 'Common', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'f1da0bbe-2569-404f-b16d-54b71ad6174b', 4),
+(5, 'JavaScript', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'c845954f-c274-4235-bbb4-5d0f9a6bb6be', 5),
+(6, 'Charts', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '', 6),
+(7, 'Alerts', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '118327e9-ee52-493b-be69-9789cfd29ef6', 7),
+(8, 'Badges', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '44413b64-844a-433a-8486-2b073be99506', 8),
+(9, 'Breadcrumbs', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '1fd13c49-7747-4399-a5d9-c340100d3102', 9),
+(10, 'Buttons', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'c17d8819-f52a-44b7-a9bd-269fa105bde3', 10),
+(11, 'Button Groups', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '5618f845-d69b-408a-aa15-ef1162be8e7a', 11),
+(12, 'Button Modifiers', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'bea7ac19-aad5-4335-b190-b8828dc5d0c8', 12),
+(13, 'Cards', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'ac7a5719-231e-4b76-90fb-025e3a2fbdb2', 13),
+(14, 'Carousel', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '243298f7-02aa-47ad-a76c-3c19e41e3011', 14),
+(15, 'Collapse', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'c3c4ac8a-ab4a-4641-b4b7-018a190f25d5', 15),
+(16, 'Dropdowns', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '94ace410-b18d-4a04-a2c2-cfb532867145', 16),
+(17, 'Forms', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '15b018d4-0161-42ad-aa34-6ed242852da9', 17),
+(18, 'Form Input Groups', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '0f712af8-684e-4996-9920-c8ad60abea0a', 18),
+(19, 'Custom Forms', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'b101b15b-dbad-4884-bd22-bd4270f97b35', 19),
+(20, 'Grid', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '03cf9f8c-98ad-4fc2-9ac0-d4b94fb9f0a9', 20),
+(21, 'Images', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '1fa5a6e4-cf23-4343-84be-fc3b2a11d78e', 21),
+(22, 'Jumbotron', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '59b8fb82-3baa-448a-a35b-03615849c79e', 22),
+(23, 'List Group', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'b236f670-2139-4bb1-a4d5-d987d99bcd77', 23),
+(24, 'Media Objects', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '58b042c6-8758-465a-b4cf-adcf1b9a117b', 24),
+(25, 'Modal', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'dc9303fa-606e-4371-b635-78d974006597', 25),
+(26, 'Navs', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '598c50a1-5fa2-4d44-8dd1-dbf1bfb4c64a', 26),
+(27, 'Navbar', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'bdbbff94-2a74-4eb3-81ce-26068937e1c8', 27),
+(28, 'Pagination', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'bcf6a838-919a-4d56-bcf1-f3dab99737c9', 28),
+(29, 'Popover', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '3e5b282f-e964-4734-b97a-06677ded9ede', 29),
+(30, 'Progress', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '0fe0ad4d-99b3-4f68-bf6e-5c71a621d8c3', 30),
+(31, 'Scrollspy', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'fbc5cad8-91b4-4e3d-84a5-47e561319047', 31),
+(32, 'Tables', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'daa2ae4f-cc62-482a-be4c-f54589f1263a', 32),
+(33, 'Tooltips', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '6709de33-eff4-41b8-850d-c530a6cf6468', 33),
+(34, 'Typography', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '675a9b0b-31bf-4bb9-aab4-aef6e3cb0447', 34),
+(35, 'Utility: Borders', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '3e7e5183-0b6a-4c9d-8ff0-22ed8870e2e0', 35),
+(36, 'Utility: Colors', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'eaa09d56-f468-4bdf-b9f0-81d2a50c372e', 36),
+(37, 'Utility: Display', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, 'e0f4d5c6-8079-4165-8c8f-0d39abf990eb', 37),
+(38, 'Utility: Flexbox', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '3dfce6f8-f0c2-4f2c-8dc2-b61d86510438', 38),
+(39, 'Utility: Misc', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '9d168738-fe4f-4aa6-aee4-ef86f8ffab2c', 39),
+(40, 'Utility: Positioning', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '922f0ec3-9f37-41ba-9a07-4e5cd768dfa8', 40),
+(41, 'Utility: Sizing', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '9ec21d99-a329-49c8-b4f4-ed980a1b9fc4', 41),
+(42, 'Utility: Spacing', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '847c72f3-bd0d-4a64-8f03-194b31fd7975', 42),
+(43, 'Utility: Text', '', '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 0, '15a3bf1f-468c-494b-8a54-2cd4ac7076d9', 43);
--
-- Dumping data for table `#__componentbuilder_library_files_folders_urls`
--
-
INSERT INTO `#__componentbuilder_library_files_folders_urls` (`id`, `addfiles`, `addfolders`, `addurls`, `library`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
-(2, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.6.2\\/js\\/bootstrap.min.js\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.6.2\\/css\\/bootstrap.min.css\",\"type\":2}}', '6f6650a5-ebff-4783-8508-f0285c0e98a6', '', 1, '2017-11-25 16:17:36', '2024-09-08 22:33:32', 12, '', 2),
-(3, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/uikit@3.21.11\\/dist\\/css\\/uikit.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/uikit@3.21.11\\/dist\\/js\\/uikit.min.js\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/uikit@3.21.11\\/dist\\/js\\/uikit-icons.min.js\",\"type\":2},\"addurls3\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/gh\\/vdm-io\\/uikit@2.0.5\\/dist\\/js\\/Uploader.min.js\",\"type\":2}}', '5eeee148-cebd-4a92-bc0e-56efea3cffdc', '', 1, '2017-11-25 21:47:40', '2024-09-08 22:27:00', 13, '', 3),
-(8, '{}', '{}', '{\"addurls2\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/1.10.21\\/js\\/jquery.dataTables.min.js\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/1.10.21\\/css\\/dataTables.uikit.min.css\",\"type\":2}}', 'cc16cffd-587d-4720-ab1b-e4120db1e85e', '', 1, '2020-06-27 21:34:44', '0000-00-00 00:00:00', 1, '', 7),
-(9, '{}', '{}', '{\"addurls3\":{\"url\":\"http:\\/\\/code.jquery.com\\/ui\\/1.11.1\\/themes\\/smoothness\\/jquery-ui.css\",\"type\":2},\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/jquery-ui-timepicker-addon\\/1.6.3\\/jquery-ui-timepicker-addon.min.css\",\"type\":2},\"addurls1\":{\"url\":\"http:\\/\\/code.jquery.com\\/ui\\/1.11.1\\/jquery-ui.min.js\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/jquery-ui-timepicker-addon\\/1.6.3\\/jquery-ui-timepicker-addon.min.js\",\"type\":2}}', '3989928c-0dac-4c30-bcdd-8a736b5c5121', '', 1, '2020-06-29 00:00:44', '2020-06-29 04:32:57', 4, '', 8),
-(10, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/dt\\/jszip-2.5.0\\/dt-1.11.5\\/b-2.2.2\\/b-colvis-2.2.2\\/b-html5-2.2.2\\/b-print-2.2.2\\/cr-1.5.5\\/date-1.1.2\\/fc-4.0.2\\/fh-3.2.2\\/kt-2.6.4\\/r-2.2.9\\/rg-1.1.4\\/rr-1.2.8\\/sc-2.0.5\\/sb-1.3.2\\/sp-2.0.0\\/sl-1.3.4\\/sr-1.1.0\\/datatables.min.css\",\"type\":3},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.1.36\\/pdfmake.min.js\",\"type\":3},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.1.36\\/vfs_fonts.js\",\"type\":3},\"addurls3\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/dt\\/jszip-2.5.0\\/dt-1.11.5\\/b-2.2.2\\/b-colvis-2.2.2\\/b-html5-2.2.2\\/b-print-2.2.2\\/cr-1.5.5\\/date-1.1.2\\/fc-4.0.2\\/fh-3.2.2\\/kt-2.6.4\\/r-2.2.9\\/rg-1.1.4\\/rr-1.2.8\\/sc-2.0.5\\/sb-1.3.2\\/sp-2.0.0\\/sl-1.3.4\\/sr-1.1.0\\/datatables.min.js\",\"type\":3}}', '4c3e3dce-0845-46cb-9e4a-494f75dc7dd8', '', 1, '2022-10-17 20:56:24', '0000-00-00 00:00:00', 1, '', 9),
-(11, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/nouislider\\/dist\\/nouislider.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/nouislider\\/dist\\/nouislider.min.js\",\"type\":2}}', '2ccbb15a-65d7-4a35-b732-0cf6b72c9275', '', 1, '2023-06-26 15:02:42', '2023-07-24 18:11:41', 3, '', 10),
-(12, '{}', '{}', '{\"addurls4\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/bs5\\/jszip-3.10.1\\/dt-2.0.2\\/b-3.0.1\\/b-colvis-3.0.1\\/b-html5-3.0.1\\/b-print-3.0.1\\/cr-2.0.0\\/date-1.5.2\\/fc-5.0.0\\/fh-4.0.1\\/kt-2.12.0\\/r-3.0.0\\/rg-1.5.0\\/rr-1.5.0\\/sc-2.4.1\\/sb-1.7.0\\/sp-2.3.0\\/sl-2.0.0\\/sr-1.4.0\\/datatables.min.css\",\"type\":3},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.2.7\\/pdfmake.min.js\",\"type\":3},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.2.7\\/vfs_fonts.js\",\"type\":3},\"addurls3\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/bs5\\/jszip-3.10.1\\/dt-2.0.2\\/b-3.0.1\\/b-colvis-3.0.1\\/b-html5-3.0.1\\/b-print-3.0.1\\/cr-2.0.0\\/date-1.5.2\\/fc-5.0.0\\/fh-4.0.1\\/kt-2.12.0\\/r-3.0.0\\/rg-1.5.0\\/rr-1.5.0\\/sc-2.4.1\\/sb-1.7.0\\/sp-2.3.0\\/sl-2.0.0\\/sr-1.4.0\\/datatables.min.js\",\"type\":3}}', '876b88eb-5d34-4f90-a896-80327593a787', '', 1, '2024-03-09 16:27:28', '2024-03-09 16:29:30', 2, '', 9);
-
---
--- Dumping data for table `#__componentbuilder_class_extends`
---
-
-INSERT INTO `#__componentbuilder_class_extends` (`id`, `comment`, `extension_type`, `head`, `name`, `params`, `published`, `created`, `modified`, `version`, `guid`, `hits`, `ordering`) VALUES
-(1, 'LyoqDQogKiBbW1tQbHVnaW5fbmFtZV1dXSBwbHVnaW4uDQogKg0KICogQHBhY2thZ2UgICBbW1tQbHVnaW5dXV0NCiAqIEBzaW5jZSAgICAgW1tbcGx1Z2luLnZlcnNpb25dXV0NCiAqLw==', 'plugins', 'dXNlIEpvb21sYVxDTVNcQXBwbGljYXRpb25cQ01TQXBwbGljYXRpb247DQp1c2UgSm9vbWxhXENNU1xQbHVnaW5cQ01TUGx1Z2luOw0K', 'CMSPlugin', '', 1, '2019-08-23 00:11:33', '2023-08-22 03:50:43', 5, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', '', 1),
-(2, 'LyoqDQogKiBbW1tQbHVnaW5fbmFtZV1dXSBwbHVnaW4uDQogKg0KICogQHBhY2thZ2UgICBbW1tQbHVnaW5dXV0NCiAqIEBzaW5jZSAgICAgW1tbcGx1Z2luLnZlcnNpb25dXV0NCiAqLw==', 'plugins', 'dXNlIEpvb21sYVxDTVNcQXBwbGljYXRpb25cQ01TQXBwbGljYXRpb247DQoNCkpMb2FkZXI6OmltcG9ydCgnY29tcG9uZW50cy5jb21fZmllbGRzLmxpYnJhcmllcy5maWVsZHNsaXN0cGx1Z2luJywgSlBBVEhfQURNSU5JU1RSQVRPUik7DQo=', 'FieldsListPlugin', '', 1, '2019-08-23 00:11:33', '2019-08-23 00:14:06', 3, '837cda37-d614-407f-ba60-9d4b8f3dfc1f', '', 1),
-(3, 'LyoqDQogKiBbW1tQbHVnaW5fbmFtZV1dXSBwbHVnaW4uDQogKg0KICogQHBhY2thZ2UgICBbW1tQbHVnaW5dXV0NCiAqIEBzaW5jZSAgICAgW1tbcGx1Z2luLnZlcnNpb25dXV0NCiAqLw==', 'plugins', 'dXNlIEpvb21sYVxDTVNcQ29tcG9uZW50XENvbXBvbmVudEhlbHBlcjsNCg0KSkxvYWRlcjo6cmVnaXN0ZXIoJ0ZpbmRlckluZGV4ZXJBZGFwdGVyJywgSlBBVEhfQURNSU5JU1RSQVRPUiAuICcvY29tcG9uZW50cy9jb21fZmluZGVyL2hlbHBlcnMvaW5kZXhlci9hZGFwdGVyLnBocCcpOw0K', 'FinderIndexerAdapter', '', 1, '2019-08-23 00:11:33', '2019-08-23 00:13:39', 2, 'e896fa8c-04b3-4edd-b681-fdd235945966', '', 1),
-(4, 'LyoqDQogKiBbW1tQbHVnaW5fbmFtZV1dXSBwbHVnaW4uDQogKg0KICogQHBhY2thZ2UgICBbW1tQbHVnaW5dXV0NCiAqIEBzaW5jZSAgICAgW1tbcGx1Z2luLnZlcnNpb25dXV0NCiAqLw==', 'plugins', 'dXNlIEpvb21sYVxDTVNcQXBwbGljYXRpb25cQ01TQXBwbGljYXRpb247DQp1c2UgSm9vbWxhXERhdGFiYXNlXERhdGFiYXNlRHJpdmVyOw0KDQpKTG9hZGVyOjpyZWdpc3RlcignUHJpdmFjeVBsdWdpbicsIEpQQVRIX0FETUlOSVNUUkFUT1IgLiAnL2NvbXBvbmVudHMvY29tX3ByaXZhY3kvaGVscGVycy9wbHVnaW4ucGhwJyk7DQpKTG9hZGVyOjpyZWdpc3RlcignUHJpdmFjeVJlbW92YWxTdGF0dXMnLCBKUEFUSF9BRE1JTklTVFJBVE9SIC4gJy9jb21wb25lbnRzL2NvbV9wcml2YWN5L2hlbHBlcnMvcmVtb3ZhbC9zdGF0dXMucGhwJyk7DQo=', 'PrivacyPlugin', '', 1, '2019-08-23 00:11:33', '2019-08-23 00:12:43', 2, '204d6d55-d4c7-4162-bd2c-39d19302b406', '', 1);
+(2, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.6.2\\/js\\/bootstrap.min.js\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.6.2\\/css\\/bootstrap.min.css\",\"type\":2}}', '6f6650a5-ebff-4783-8508-f0285c0e98a6', '', 1, '2017-11-25 16:17:36', '2024-09-08 22:33:32', 12, 0, 2),
+(3, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/uikit@3.21.11\\/dist\\/css\\/uikit.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/uikit@3.21.11\\/dist\\/js\\/uikit.min.js\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/uikit@3.21.11\\/dist\\/js\\/uikit-icons.min.js\",\"type\":2},\"addurls3\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/gh\\/vdm-io\\/uikit@2.0.5\\/dist\\/js\\/Uploader.min.js\",\"type\":2}}', '5eeee148-cebd-4a92-bc0e-56efea3cffdc', '', 1, '2017-11-25 21:47:40', '2024-09-08 22:27:00', 13, 0, 3),
+(8, '{}', '{}', '{\"addurls2\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/1.10.21\\/js\\/jquery.dataTables.min.js\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/1.10.21\\/css\\/dataTables.uikit.min.css\",\"type\":2}}', 'cc16cffd-587d-4720-ab1b-e4120db1e85e', '', 1, '2020-06-27 21:34:44', '0000-00-00 00:00:00', 1, 0, 7),
+(9, '{}', '{}', '{\"addurls3\":{\"url\":\"http:\\/\\/code.jquery.com\\/ui\\/1.11.1\\/themes\\/smoothness\\/jquery-ui.css\",\"type\":2},\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/jquery-ui-timepicker-addon\\/1.6.3\\/jquery-ui-timepicker-addon.min.css\",\"type\":2},\"addurls1\":{\"url\":\"http:\\/\\/code.jquery.com\\/ui\\/1.11.1\\/jquery-ui.min.js\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/jquery-ui-timepicker-addon\\/1.6.3\\/jquery-ui-timepicker-addon.min.js\",\"type\":2}}', '3989928c-0dac-4c30-bcdd-8a736b5c5121', '', 1, '2020-06-29 00:00:44', '2020-06-29 04:32:57', 4, 0, 8),
+(10, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/dt\\/jszip-2.5.0\\/dt-1.11.5\\/b-2.2.2\\/b-colvis-2.2.2\\/b-html5-2.2.2\\/b-print-2.2.2\\/cr-1.5.5\\/date-1.1.2\\/fc-4.0.2\\/fh-3.2.2\\/kt-2.6.4\\/r-2.2.9\\/rg-1.1.4\\/rr-1.2.8\\/sc-2.0.5\\/sb-1.3.2\\/sp-2.0.0\\/sl-1.3.4\\/sr-1.1.0\\/datatables.min.css\",\"type\":3},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.1.36\\/pdfmake.min.js\",\"type\":3},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.1.36\\/vfs_fonts.js\",\"type\":3},\"addurls3\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/dt\\/jszip-2.5.0\\/dt-1.11.5\\/b-2.2.2\\/b-colvis-2.2.2\\/b-html5-2.2.2\\/b-print-2.2.2\\/cr-1.5.5\\/date-1.1.2\\/fc-4.0.2\\/fh-3.2.2\\/kt-2.6.4\\/r-2.2.9\\/rg-1.1.4\\/rr-1.2.8\\/sc-2.0.5\\/sb-1.3.2\\/sp-2.0.0\\/sl-1.3.4\\/sr-1.1.0\\/datatables.min.js\",\"type\":3}}', '4c3e3dce-0845-46cb-9e4a-494f75dc7dd8', '', 1, '2022-10-17 20:56:24', '0000-00-00 00:00:00', 1, 0, 9),
+(11, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/nouislider\\/dist\\/nouislider.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/nouislider\\/dist\\/nouislider.min.js\",\"type\":2}}', '2ccbb15a-65d7-4a35-b732-0cf6b72c9275', '', 1, '2023-06-26 15:02:42', '2023-07-24 18:11:41', 3, 0, 10),
+(12, '{}', '{}', '{\"addurls4\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/bs5\\/jszip-3.10.1\\/dt-2.0.2\\/b-3.0.1\\/b-colvis-3.0.1\\/b-html5-3.0.1\\/b-print-3.0.1\\/cr-2.0.0\\/date-1.5.2\\/fc-5.0.0\\/fh-4.0.1\\/kt-2.12.0\\/r-3.0.0\\/rg-1.5.0\\/rr-1.5.0\\/sc-2.4.1\\/sb-1.7.0\\/sp-2.3.0\\/sl-2.0.0\\/sr-1.4.0\\/datatables.min.css\",\"type\":3},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.2.7\\/pdfmake.min.js\",\"type\":3},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.2.7\\/vfs_fonts.js\",\"type\":3},\"addurls3\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/bs5\\/jszip-3.10.1\\/dt-2.0.2\\/b-3.0.1\\/b-colvis-3.0.1\\/b-html5-3.0.1\\/b-print-3.0.1\\/cr-2.0.0\\/date-1.5.2\\/fc-5.0.0\\/fh-4.0.1\\/kt-2.12.0\\/r-3.0.0\\/rg-1.5.0\\/rr-1.5.0\\/sc-2.4.1\\/sb-1.7.0\\/sp-2.3.0\\/sl-2.0.0\\/sr-1.4.0\\/datatables.min.js\",\"type\":3}}', '876b88eb-5d34-4f90-a896-80327593a787', '', 1, '2024-03-09 16:27:28', '2024-03-09 16:29:30', 2, 0, 9);
--
-- Dumping data for table `#__componentbuilder_joomla_plugin_group`
--
-
INSERT INTO `#__componentbuilder_joomla_plugin_group` (`id`, `class_extends`, `name`, `params`, `published`, `created`, `modified`, `version`, `guid`, `hits`, `ordering`) VALUES
-(1, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'authentication', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '', '', 1),
-(2, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'behaviour', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '', '', 1),
-(3, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'content', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '37f35ae4-fc6c-49f0-b070-8701da85455d', '', 1),
-(4, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'editors-xtd', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '', '', 1),
-(5, '837cda37-d614-407f-ba60-9d4b8f3dfc1f', 'fields', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '', '', 1),
-(6, 'e896fa8c-04b3-4edd-b681-fdd235945966', 'finder', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '', '', 1),
-(7, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'search', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '', '', 1),
-(8, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'system', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '3f139f81-0697-4392-b065-6426adaa7ac6', '', 1),
-(9, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'user', '', 1, '2019-07-15 11:06:03', '0000-00-00 00:00:00', 1, '', '', 1),
-(10, '204d6d55-d4c7-4162-bd2c-39d19302b406', 'privacy', '', 1, '2019-07-16 00:25:53', '0000-00-00 00:00:00', 1, '2d8677ea-cda3-48d3-828d-da656c52dbe1', '', 2),
-(11, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'extension', '', 1, '2019-08-14 14:59:09', '0000-00-00 00:00:00', 1, 'e0947c15-d3d0-4e21-8e60-044ee8a946d6', '', 3),
-(12, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'installer', '', 1, '2019-08-14 14:59:09', '0000-00-00 00:00:00', 1, '93940067-92d1-4cc2-b4e2-d3fc118d99bd', '', 3);
+(1, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'authentication', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:54:12', 3, 'ca987443-0740-48ad-9db3-c623cdb02d51', 0, 1),
+(2, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'behaviour', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:54:17', 3, '976cc8de-7092-41b8-9c04-f00be8fe4bde', 0, 1),
+(3, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'content', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:54:22', 3, '37f35ae4-fc6c-49f0-b070-8701da85455d', 0, 1),
+(4, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'editors-xtd', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:54:27', 3, '9d4e911a-866f-4363-a47e-fc63f219aa01', 0, 1),
+(5, '837cda37-d614-407f-ba60-9d4b8f3dfc1f', 'fields', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:54:32', 3, 'cc5b64a6-dbec-45b7-97e2-87893ea6827d', 0, 1),
+(6, 'e896fa8c-04b3-4edd-b681-fdd235945966', 'finder', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:54:38', 3, '75021594-d111-4e01-9d42-4e86e57bbec3', 0, 1),
+(7, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'search', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:54:47', 5, '6ada52b0-ef05-455b-9cd7-de0d4f3aff73', 0, 1),
+(8, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'system', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:54:58', 5, '3f139f81-0697-4392-b065-6426adaa7ac6', 0, 1),
+(9, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'user', '', 1, '2019-07-15 11:06:03', '2025-05-31 18:55:02', 4, '22d28e9f-1dfd-45f1-ab44-0b84259c2e00', 0, 1),
+(10, '204d6d55-d4c7-4162-bd2c-39d19302b406', 'privacy', '', 1, '2019-07-16 00:25:53', '2025-05-31 18:55:05', 5, '2d8677ea-cda3-48d3-828d-da656c52dbe1', 0, 2),
+(11, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'extension', '', 1, '2019-08-14 14:59:09', '2025-05-31 18:55:08', 4, 'e0947c15-d3d0-4e21-8e60-044ee8a946d6', 0, 3),
+(12, 'ae2fafb4-e84b-4534-ba9c-6c9e1700b318', 'installer', '', 1, '2019-08-14 14:59:09', '2025-05-31 18:55:11', 3, '93940067-92d1-4cc2-b4e2-d3fc118d99bd', 0, 3);
CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` (
diff --git a/admin/sql/uninstall.mysql.utf8.sql b/admin/sql/uninstall.mysql.utf8.sql
index 5daf8f0e3..470d4b052 100644
--- a/admin/sql/uninstall.mysql.utf8.sql
+++ b/admin/sql/uninstall.mysql.utf8.sql
@@ -10,6 +10,7 @@ DROP TABLE IF EXISTS `#__componentbuilder_template`;
DROP TABLE IF EXISTS `#__componentbuilder_layout`;
DROP TABLE IF EXISTS `#__componentbuilder_dynamic_get`;
DROP TABLE IF EXISTS `#__componentbuilder_custom_code`;
+DROP TABLE IF EXISTS `#__componentbuilder_class_extends`;
DROP TABLE IF EXISTS `#__componentbuilder_class_property`;
DROP TABLE IF EXISTS `#__componentbuilder_class_method`;
DROP TABLE IF EXISTS `#__componentbuilder_placeholder`;
@@ -43,7 +44,6 @@ DROP TABLE IF EXISTS `#__componentbuilder_component_modules`;
DROP TABLE IF EXISTS `#__componentbuilder_snippet_type`;
DROP TABLE IF EXISTS `#__componentbuilder_library_config`;
DROP TABLE IF EXISTS `#__componentbuilder_library_files_folders_urls`;
-DROP TABLE IF EXISTS `#__componentbuilder_class_extends`;
DROP TABLE IF EXISTS `#__componentbuilder_joomla_module_updates`;
DROP TABLE IF EXISTS `#__componentbuilder_joomla_module_files_folders_urls`;
DROP TABLE IF EXISTS `#__componentbuilder_joomla_plugin_group`;
diff --git a/admin/sql/updates/mysql/3.2.5.sql b/admin/sql/updates/mysql/3_2_5.sql
similarity index 100%
rename from admin/sql/updates/mysql/3.2.5.sql
rename to admin/sql/updates/mysql/3_2_5.sql
diff --git a/admin/sql/updates/mysql/4.0.0.sql b/admin/sql/updates/mysql/4_0_0.sql
similarity index 100%
rename from admin/sql/updates/mysql/4.0.0.sql
rename to admin/sql/updates/mysql/4_0_0.sql
diff --git a/admin/sql/updates/mysql/4.0.1.sql b/admin/sql/updates/mysql/4_0_1.sql
similarity index 100%
rename from admin/sql/updates/mysql/4.0.1.sql
rename to admin/sql/updates/mysql/4_0_1.sql
diff --git a/admin/sql/updates/mysql/4.0.2.sql b/admin/sql/updates/mysql/4_0_2.sql
similarity index 100%
rename from admin/sql/updates/mysql/4.0.2.sql
rename to admin/sql/updates/mysql/4_0_2.sql
diff --git a/admin/sql/updates/mysql/4.0.3.sql b/admin/sql/updates/mysql/4_0_3.sql
similarity index 100%
rename from admin/sql/updates/mysql/4.0.3.sql
rename to admin/sql/updates/mysql/4_0_3.sql
diff --git a/admin/sql/updates/mysql/4.1.0.sql b/admin/sql/updates/mysql/4_1_0.sql
similarity index 100%
rename from admin/sql/updates/mysql/4.1.0.sql
rename to admin/sql/updates/mysql/4_1_0.sql
diff --git a/admin/sql/updates/mysql/4_1_1-alpha.sql b/admin/sql/updates/mysql/4_1_1-alpha.sql
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/admin/sql/updates/mysql/4_1_1-alpha.sql
@@ -0,0 +1 @@
+
diff --git a/admin/sql/updates/mysql/4_1_1-beta.sql b/admin/sql/updates/mysql/4_1_1-beta.sql
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/admin/sql/updates/mysql/4_1_1-beta.sql
@@ -0,0 +1 @@
+
diff --git a/admin/src/Controller/Admin_custom_tabsController.php b/admin/src/Controller/Admin_custom_tabsController.php
index 7de7d87c7..d313044f2 100644
--- a/admin/src/Controller/Admin_custom_tabsController.php
+++ b/admin/src/Controller/Admin_custom_tabsController.php
@@ -217,7 +217,7 @@ class Admin_custom_tabsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Admin_custom_tabs', '', []);
@@ -281,6 +281,15 @@ class Admin_custom_tabsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Admin_custom_tabsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('admin_custom_tabs.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Admin_fieldsController.php b/admin/src/Controller/Admin_fieldsController.php
index b560a05da..dd856ad01 100644
--- a/admin/src/Controller/Admin_fieldsController.php
+++ b/admin/src/Controller/Admin_fieldsController.php
@@ -217,7 +217,7 @@ class Admin_fieldsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Admin_fields', '', []);
@@ -281,6 +281,15 @@ class Admin_fieldsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Admin_fieldsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('admin_fields.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Admin_fields_conditionsController.php b/admin/src/Controller/Admin_fields_conditionsController.php
index b64fad2a4..c28ddc774 100644
--- a/admin/src/Controller/Admin_fields_conditionsController.php
+++ b/admin/src/Controller/Admin_fields_conditionsController.php
@@ -217,7 +217,7 @@ class Admin_fields_conditionsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Admin_fields_conditions', '', []);
@@ -281,6 +281,15 @@ class Admin_fields_conditionsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Admin_fields_conditionsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('admin_fields_conditions.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Admin_fields_relationsController.php b/admin/src/Controller/Admin_fields_relationsController.php
index cd2947d51..abaabb6f4 100644
--- a/admin/src/Controller/Admin_fields_relationsController.php
+++ b/admin/src/Controller/Admin_fields_relationsController.php
@@ -217,7 +217,7 @@ class Admin_fields_relationsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Admin_fields_relations', '', []);
@@ -281,6 +281,15 @@ class Admin_fields_relationsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Admin_fields_relationsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('admin_fields_relations.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Admin_viewController.php b/admin/src/Controller/Admin_viewController.php
index bce92de1d..f51c77a89 100644
--- a/admin/src/Controller/Admin_viewController.php
+++ b/admin/src/Controller/Admin_viewController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Data\Factory as DataFactory;
use VDM\Joomla\Utilities\GuidHelper;
@@ -80,6 +81,229 @@ class Admin_viewController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Admin View.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Admin View.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Admin View.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_ADMIN_VIEW') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('AdminView.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_ADMIN_VIEW_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('admin_view.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('admin_view', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_ADMIN_VIEW_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_ADMIN_VIEW_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_ADMIN_VIEW_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=admin_view'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Admin View.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Admin View.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Admin View.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_ADMIN_VIEW') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('AdminView.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_ADMIN_VIEW_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('admin_view.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('admin_view', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_ADMIN_VIEW_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_ADMIN_VIEW_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_ADMIN_VIEW_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=admin_view'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -219,7 +443,7 @@ class Admin_viewController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Admin_view', '', []);
@@ -283,6 +507,15 @@ class Admin_viewController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -365,6 +598,15 @@ class Admin_viewController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('admin_view.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
// linked tables to update
$_tables_array = [
'admin_fields' => 'admin_view',
diff --git a/admin/src/Controller/Admin_viewsController.php b/admin/src/Controller/Admin_viewsController.php
index 7f0d68a61..d5d636de5 100644
--- a/admin/src/Controller/Admin_viewsController.php
+++ b/admin/src/Controller/Admin_viewsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class Admin_viewsController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_ADMIN_VIEWS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('admin_view.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=AdminView&target=Admin Views', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Admin Views.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Admin Views.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Admin Views.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('admin_view.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('AdminView.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['admin_view'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('admin_view', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_ADMIN_VIEWS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_ADMIN_VIEWS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_ADMIN_VIEWS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Admin Views.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Admin Views.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Admin Views.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('admin_view.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('AdminView.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['admin_view'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('admin_view', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_ADMIN_VIEWS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_ADMIN_VIEWS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_ADMIN_VIEWS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=admin_views', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/AjaxController.php b/admin/src/Controller/AjaxController.php
index a23f09aca..193f41aca 100644
--- a/admin/src/Controller/AjaxController.php
+++ b/admin/src/Controller/AjaxController.php
@@ -50,11 +50,9 @@ class AjaxController extends BaseController
$this->app->setHeader('Access-Control-Allow-Origin', '*');
// load the tasks
$this->registerTask('getComponentDetails', 'ajax');
- $this->registerTask('getCronPath', 'ajax');
$this->registerTask('getWiki', 'ajax');
$this->registerTask('getVersion', 'ajax');
$this->registerTask('getJCBpackageInfo', 'ajax');
- $this->registerTask('getCrowdinDetails', 'ajax');
$this->registerTask('getModuleCode', 'ajax');
$this->registerTask('getClassCode', 'ajax');
$this->registerTask('getClassCodeIds', 'ajax');
@@ -92,6 +90,9 @@ class AjaxController extends BaseController
$this->registerTask('getSearchValue', 'ajax');
$this->registerTask('getReplaceValue', 'ajax');
$this->registerTask('setValue', 'ajax');
+ $this->registerTask('getRepoIndex', 'ajax');
+ $this->registerTask('initSelectedPowers', 'ajax');
+ $this->registerTask('initSelectedPackages', 'ajax');
}
/**
@@ -167,55 +168,6 @@ class AjaxController extends BaseController
}
}
break;
- case 'getCronPath':
- try
- {
- $getTypeValue = $jinput->get('getType', NULL, 'WORD');
- if($getTypeValue && $user->id != 0)
- {
- $ajaxModule = $this->getModel('ajax', 'Administrator');
- if ($ajaxModule)
- {
- $result = $ajaxModule->getCronPath($getTypeValue);
- }
- else
- {
- $result = ['error' => 'There was an error! [149]'];
- }
- }
- else
- {
- $result = ['error' => 'There was an error! [149]'];
- }
- if($callback)
- {
- echo $callback . "(".json_encode($result).");";
- }
- elseif($returnRaw)
- {
- echo json_encode($result);
- }
- else
- {
- echo "(".json_encode($result).");";
- }
- }
- catch(\Exception $e)
- {
- if($callback)
- {
- echo $callback."(".json_encode($e).");";
- }
- elseif($returnRaw)
- {
- echo json_encode($e);
- }
- else
- {
- echo "(".json_encode($e).");";
- }
- }
- break;
case 'getWiki':
try
{
@@ -363,56 +315,6 @@ class AjaxController extends BaseController
}
}
break;
- case 'getCrowdinDetails':
- try
- {
- $identifierValue = $jinput->get('identifier', NULL, 'CMD');
- $keyValue = $jinput->get('key', NULL, 'ALNUM');
- if($identifierValue && $user->id != 0 && $keyValue)
- {
- $ajaxModule = $this->getModel('ajax', 'Administrator');
- if ($ajaxModule)
- {
- $result = $ajaxModule->getCrowdinDetails($identifierValue, $keyValue);
- }
- else
- {
- $result = ['error' => 'There was an error! [149]'];
- }
- }
- else
- {
- $result = ['error' => 'There was an error! [149]'];
- }
- if($callback)
- {
- echo $callback . "(".json_encode($result).");";
- }
- elseif($returnRaw)
- {
- echo json_encode($result);
- }
- else
- {
- echo "(".json_encode($result).");";
- }
- }
- catch(\Exception $e)
- {
- if($callback)
- {
- echo $callback."(".json_encode($e).");";
- }
- elseif($returnRaw)
- {
- echo json_encode($e);
- }
- else
- {
- echo "(".json_encode($e).");";
- }
- }
- break;
case 'getModuleCode':
try
{
@@ -2279,6 +2181,158 @@ class AjaxController extends BaseController
}
}
break;
+ case 'getRepoIndex':
+ try
+ {
+ $repoValue = $jinput->get('repo', NULL, 'STRING');
+ $areaValue = $jinput->get('area', NULL, 'STRING');
+ if($repoValue && $user->id != 0 && $areaValue)
+ {
+ $ajaxModule = $this->getModel('ajax', 'Administrator');
+ if ($ajaxModule)
+ {
+ $result = $ajaxModule->getRepoIndex($repoValue, $areaValue);
+ }
+ else
+ {
+ $result = ['error' => 'There was an error! [149]'];
+ }
+ }
+ else
+ {
+ $result = ['error' => 'There was an error! [149]'];
+ }
+ if($callback)
+ {
+ echo $callback . "(".json_encode($result).");";
+ }
+ elseif($returnRaw)
+ {
+ echo json_encode($result);
+ }
+ else
+ {
+ echo "(".json_encode($result).");";
+ }
+ }
+ catch(\Exception $e)
+ {
+ if($callback)
+ {
+ echo $callback."(".json_encode($e).");";
+ }
+ elseif($returnRaw)
+ {
+ echo json_encode($e);
+ }
+ else
+ {
+ echo "(".json_encode($e).");";
+ }
+ }
+ break;
+ case 'initSelectedPowers':
+ try
+ {
+ $repoValue = $jinput->get('repo', NULL, 'STRING');
+ $areaValue = $jinput->get('area', NULL, 'STRING');
+ $selectedValue = $jinput->get('selected', NULL, 'ARRAY');
+ if($repoValue && $user->id != 0 && $areaValue && $selectedValue)
+ {
+ $ajaxModule = $this->getModel('ajax', 'Administrator');
+ if ($ajaxModule)
+ {
+ $result = $ajaxModule->initSelectedPowers($repoValue, $areaValue, $selectedValue);
+ }
+ else
+ {
+ $result = ['error' => 'There was an error! [149]'];
+ }
+ }
+ else
+ {
+ $result = ['error' => 'There was an error! [149]'];
+ }
+ if($callback)
+ {
+ echo $callback . "(".json_encode($result).");";
+ }
+ elseif($returnRaw)
+ {
+ echo json_encode($result);
+ }
+ else
+ {
+ echo "(".json_encode($result).");";
+ }
+ }
+ catch(\Exception $e)
+ {
+ if($callback)
+ {
+ echo $callback."(".json_encode($e).");";
+ }
+ elseif($returnRaw)
+ {
+ echo json_encode($e);
+ }
+ else
+ {
+ echo "(".json_encode($e).");";
+ }
+ }
+ break;
+ case 'initSelectedPackages':
+ try
+ {
+ $repoValue = $jinput->get('repo', NULL, 'STRING');
+ $areaValue = $jinput->get('area', NULL, 'STRING');
+ $selectedValue = $jinput->get('selected', NULL, 'ARRAY');
+ if($repoValue && $user->id != 0 && $areaValue && $selectedValue)
+ {
+ $ajaxModule = $this->getModel('ajax', 'Administrator');
+ if ($ajaxModule)
+ {
+ $result = $ajaxModule->initSelectedPackages($repoValue, $areaValue, $selectedValue);
+ }
+ else
+ {
+ $result = ['error' => 'There was an error! [149]'];
+ }
+ }
+ else
+ {
+ $result = ['error' => 'There was an error! [149]'];
+ }
+ if($callback)
+ {
+ echo $callback . "(".json_encode($result).");";
+ }
+ elseif($returnRaw)
+ {
+ echo json_encode($result);
+ }
+ else
+ {
+ echo "(".json_encode($result).");";
+ }
+ }
+ catch(\Exception $e)
+ {
+ if($callback)
+ {
+ echo $callback."(".json_encode($e).");";
+ }
+ elseif($returnRaw)
+ {
+ echo json_encode($e);
+ }
+ else
+ {
+ echo "(".json_encode($e).");";
+ }
+ }
+ break;
}
}
else
diff --git a/admin/src/Controller/Class_extendingsController.php b/admin/src/Controller/Class_extendingsController.php
index 6d30e5b10..810406757 100644
--- a/admin/src/Controller/Class_extendingsController.php
+++ b/admin/src/Controller/Class_extendingsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class Class_extendingsController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_CLASS_EXTENDINGS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('class_extends.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=ClassExtends&target=Class Extendings', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_extendings', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Class Extendings.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Class Extendings.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Class Extendings.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_extendings', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('class_extends.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassExtends.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['class_extends'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('class_extends', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CLASS_EXTENDINGS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_CLASS_EXTENDINGS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_EXTENDINGS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_extendings', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_extendings', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Class Extendings.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Class Extendings.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Class Extendings.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_extendings', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('class_extends.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassExtends.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['class_extends'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('class_extends', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CLASS_EXTENDINGS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_EXTENDINGS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_EXTENDINGS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_extendings', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_extendings', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/Class_extendsController.php b/admin/src/Controller/Class_extendsController.php
index d02753f63..b79cafbb3 100644
--- a/admin/src/Controller/Class_extendsController.php
+++ b/admin/src/Controller/Class_extendsController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class Class_extendsController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Class Extends.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Class Extends.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Class Extends.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_CLASS_EXTENDS') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassExtends.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CLASS_EXTENDS_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('class_extends.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('class_extends', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CLASS_EXTENDS_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_EXTENDS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_EXTENDS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=class_extends'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Class Extends.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Class Extends.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Class Extends.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_CLASS_EXTENDS') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassExtends.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CLASS_EXTENDS_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('class_extends.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('class_extends', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CLASS_EXTENDS_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_EXTENDS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_EXTENDS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=class_extends'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class Class_extendsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Class_extends', '', []);
@@ -281,6 +505,15 @@ class Class_extendsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class Class_extendsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('class_extends.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Class_methodController.php b/admin/src/Controller/Class_methodController.php
index 884091bd9..05be133e3 100644
--- a/admin/src/Controller/Class_methodController.php
+++ b/admin/src/Controller/Class_methodController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class Class_methodController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Class Method.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Class Method.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Class Method.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_CLASS_METHOD') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassMethod.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CLASS_METHOD_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('class_method.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('class_method', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CLASS_METHOD_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_METHOD_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_METHOD_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=class_method'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Class Method.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Class Method.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Class Method.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_CLASS_METHOD') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassMethod.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CLASS_METHOD_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('class_method.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('class_method', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CLASS_METHOD_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_METHOD_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_METHOD_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=class_method'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class Class_methodController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Class_method', '', []);
@@ -281,6 +505,15 @@ class Class_methodController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class Class_methodController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('class_method.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Class_methodsController.php b/admin/src/Controller/Class_methodsController.php
index bccaa00e5..b291fc34d 100644
--- a/admin/src/Controller/Class_methodsController.php
+++ b/admin/src/Controller/Class_methodsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class Class_methodsController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_CLASS_METHODS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('class_method.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=ClassProperty&target=Class Methods', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_methods', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Class Methods.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Class Methods.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Class Methods.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_methods', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('class_method.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassProperty.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['class_method'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('class_method', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CLASS_METHODS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_CLASS_METHODS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_METHODS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_methods', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_methods', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Class Methods.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Class Methods.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Class Methods.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_methods', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('class_method.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassProperty.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['class_method'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('class_method', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CLASS_METHODS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_METHODS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_METHODS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_methods', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_methods', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/Class_propertiesController.php b/admin/src/Controller/Class_propertiesController.php
index 8c733c149..1313d4bd4 100644
--- a/admin/src/Controller/Class_propertiesController.php
+++ b/admin/src/Controller/Class_propertiesController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class Class_propertiesController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_CLASS_PROPERTIES') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('class_property.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=ClassProperty&target=Class Properties', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_properties', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Class Properties.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Class Properties.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Class Properties.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_properties', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('class_property.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassProperty.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['class_property'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('class_property', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CLASS_PROPERTIES_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_CLASS_PROPERTIES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_PROPERTIES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_properties', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_properties', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Class Properties.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Class Properties.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Class Properties.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_properties', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('class_property.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassProperty.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['class_property'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('class_property', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CLASS_PROPERTIES_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_PROPERTIES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_PROPERTIES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_properties', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=class_properties', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/Class_propertyController.php b/admin/src/Controller/Class_propertyController.php
index 75164ff4d..3d7819942 100644
--- a/admin/src/Controller/Class_propertyController.php
+++ b/admin/src/Controller/Class_propertyController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class Class_propertyController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Class Property.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Class Property.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Class Property.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_CLASS_PROPERTY') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassProperty.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CLASS_PROPERTY_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('class_property.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('class_property', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CLASS_PROPERTY_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_PROPERTY_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CLASS_PROPERTY_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=class_property'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Class Property.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Class Property.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Class Property.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_CLASS_PROPERTY') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('ClassProperty.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CLASS_PROPERTY_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('class_property.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('class_property', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CLASS_PROPERTY_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_PROPERTY_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CLASS_PROPERTY_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=class_property'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class Class_propertyController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Class_property', '', []);
@@ -281,6 +505,15 @@ class Class_propertyController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class Class_propertyController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('class_property.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_admin_viewsController.php b/admin/src/Controller/Component_admin_viewsController.php
index eaae33ba3..454622bb2 100644
--- a/admin/src/Controller/Component_admin_viewsController.php
+++ b/admin/src/Controller/Component_admin_viewsController.php
@@ -217,7 +217,7 @@ class Component_admin_viewsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_admin_views', '', []);
@@ -281,6 +281,15 @@ class Component_admin_viewsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_admin_viewsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_admin_views.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_configController.php b/admin/src/Controller/Component_configController.php
index e2fa146c8..74d7524d9 100644
--- a/admin/src/Controller/Component_configController.php
+++ b/admin/src/Controller/Component_configController.php
@@ -217,7 +217,7 @@ class Component_configController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_config', '', []);
@@ -281,6 +281,15 @@ class Component_configController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_configController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_config.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_custom_admin_menusController.php b/admin/src/Controller/Component_custom_admin_menusController.php
index 94563c494..32b2b082e 100644
--- a/admin/src/Controller/Component_custom_admin_menusController.php
+++ b/admin/src/Controller/Component_custom_admin_menusController.php
@@ -217,7 +217,7 @@ class Component_custom_admin_menusController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_custom_admin_menus', '', []);
@@ -281,6 +281,15 @@ class Component_custom_admin_menusController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_custom_admin_menusController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_custom_admin_menus.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_custom_admin_viewsController.php b/admin/src/Controller/Component_custom_admin_viewsController.php
index 07db19a02..854b8ca8c 100644
--- a/admin/src/Controller/Component_custom_admin_viewsController.php
+++ b/admin/src/Controller/Component_custom_admin_viewsController.php
@@ -217,7 +217,7 @@ class Component_custom_admin_viewsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_custom_admin_views', '', []);
@@ -281,6 +281,15 @@ class Component_custom_admin_viewsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_custom_admin_viewsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_custom_admin_views.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_dashboardController.php b/admin/src/Controller/Component_dashboardController.php
index 312720827..683378381 100644
--- a/admin/src/Controller/Component_dashboardController.php
+++ b/admin/src/Controller/Component_dashboardController.php
@@ -217,7 +217,7 @@ class Component_dashboardController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_dashboard', '', []);
@@ -281,6 +281,15 @@ class Component_dashboardController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_dashboardController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_dashboard.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_files_foldersController.php b/admin/src/Controller/Component_files_foldersController.php
index 5f100fde1..193141901 100644
--- a/admin/src/Controller/Component_files_foldersController.php
+++ b/admin/src/Controller/Component_files_foldersController.php
@@ -217,7 +217,7 @@ class Component_files_foldersController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_files_folders', '', []);
@@ -281,6 +281,15 @@ class Component_files_foldersController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_files_foldersController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_files_folders.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_modulesController.php b/admin/src/Controller/Component_modulesController.php
index 6de33ee47..a82d2fa74 100644
--- a/admin/src/Controller/Component_modulesController.php
+++ b/admin/src/Controller/Component_modulesController.php
@@ -217,7 +217,7 @@ class Component_modulesController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_modules', '', []);
@@ -281,6 +281,15 @@ class Component_modulesController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_modulesController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_modules.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_mysql_tweaksController.php b/admin/src/Controller/Component_mysql_tweaksController.php
index bb4730173..a2ceb3f70 100644
--- a/admin/src/Controller/Component_mysql_tweaksController.php
+++ b/admin/src/Controller/Component_mysql_tweaksController.php
@@ -217,7 +217,7 @@ class Component_mysql_tweaksController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_mysql_tweaks', '', []);
@@ -281,6 +281,15 @@ class Component_mysql_tweaksController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_mysql_tweaksController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_mysql_tweaks.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_placeholdersController.php b/admin/src/Controller/Component_placeholdersController.php
index 2a1d4ce0e..f07c24406 100644
--- a/admin/src/Controller/Component_placeholdersController.php
+++ b/admin/src/Controller/Component_placeholdersController.php
@@ -217,7 +217,7 @@ class Component_placeholdersController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_placeholders', '', []);
@@ -281,6 +281,15 @@ class Component_placeholdersController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_placeholdersController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_placeholders.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_pluginsController.php b/admin/src/Controller/Component_pluginsController.php
index 176e1fc69..e3422a342 100644
--- a/admin/src/Controller/Component_pluginsController.php
+++ b/admin/src/Controller/Component_pluginsController.php
@@ -217,7 +217,7 @@ class Component_pluginsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_plugins', '', []);
@@ -281,6 +281,15 @@ class Component_pluginsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_pluginsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_plugins.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_routerController.php b/admin/src/Controller/Component_routerController.php
index b8c479edf..2b733656f 100644
--- a/admin/src/Controller/Component_routerController.php
+++ b/admin/src/Controller/Component_routerController.php
@@ -217,7 +217,7 @@ class Component_routerController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_router', '', []);
@@ -281,6 +281,15 @@ class Component_routerController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_routerController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_router.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_site_viewsController.php b/admin/src/Controller/Component_site_viewsController.php
index 9a8889671..a2f4f3cc7 100644
--- a/admin/src/Controller/Component_site_viewsController.php
+++ b/admin/src/Controller/Component_site_viewsController.php
@@ -217,7 +217,7 @@ class Component_site_viewsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_site_views', '', []);
@@ -281,6 +281,15 @@ class Component_site_viewsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Component_site_viewsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_site_views.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Component_updatesController.php b/admin/src/Controller/Component_updatesController.php
index 62b4415cc..1f6d05d9b 100644
--- a/admin/src/Controller/Component_updatesController.php
+++ b/admin/src/Controller/Component_updatesController.php
@@ -221,7 +221,7 @@ class Component_updatesController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component_updates', '', []);
@@ -285,6 +285,15 @@ class Component_updatesController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -367,6 +376,15 @@ class Component_updatesController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('component_updates.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
// update the component version to match the updated last version
if (isset($validData['joomla_component']) && GuidHelper::valid($validData['joomla_component']))
{
diff --git a/admin/src/Controller/Custom_admin_viewController.php b/admin/src/Controller/Custom_admin_viewController.php
index ad4ac2da7..ae8b06625 100644
--- a/admin/src/Controller/Custom_admin_viewController.php
+++ b/admin/src/Controller/Custom_admin_viewController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class Custom_admin_viewController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Custom Admin View.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Custom Admin View.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Custom Admin View.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_CUSTOM_ADMIN_VIEW') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('CustomAdminView.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CUSTOM_ADMIN_VIEW_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('custom_admin_view.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('custom_admin_view', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CUSTOM_ADMIN_VIEW_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CUSTOM_ADMIN_VIEW_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CUSTOM_ADMIN_VIEW_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=custom_admin_view'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Custom Admin View.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Custom Admin View.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Custom Admin View.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_CUSTOM_ADMIN_VIEW') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('CustomAdminView.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CUSTOM_ADMIN_VIEW_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('custom_admin_view.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('custom_admin_view', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CUSTOM_ADMIN_VIEW_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CUSTOM_ADMIN_VIEW_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CUSTOM_ADMIN_VIEW_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=custom_admin_view'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class Custom_admin_viewController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Custom_admin_view', '', []);
@@ -281,6 +505,15 @@ class Custom_admin_viewController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class Custom_admin_viewController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('custom_admin_view.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Custom_admin_viewsController.php b/admin/src/Controller/Custom_admin_viewsController.php
index bca87d340..12d793439 100644
--- a/admin/src/Controller/Custom_admin_viewsController.php
+++ b/admin/src/Controller/Custom_admin_viewsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -52,12 +53,272 @@ class Custom_admin_viewsController extends AdminController
return parent::getModel($name, $prefix, $config);
}
- public function getSnippets()
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the import snippets custom admin view
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false));
- return;
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_CUSTOM_ADMIN_VIEWS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('custom_admin_view.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=CustomAdminView&target=Custom Admin Views', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Custom Admin Views.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Custom Admin Views.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Custom Admin Views.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('custom_admin_view.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('CustomAdminView.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['custom_admin_view'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('custom_admin_view', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CUSTOM_ADMIN_VIEWS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_CUSTOM_ADMIN_VIEWS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CUSTOM_ADMIN_VIEWS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Custom Admin Views.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Custom Admin Views.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Custom Admin Views.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('custom_admin_view.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('CustomAdminView.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['custom_admin_view'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('custom_admin_view', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CUSTOM_ADMIN_VIEWS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CUSTOM_ADMIN_VIEWS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CUSTOM_ADMIN_VIEWS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
}
}
\ No newline at end of file
diff --git a/admin/src/Controller/Custom_codeController.php b/admin/src/Controller/Custom_codeController.php
index c4f0bd5cf..db06c8084 100644
--- a/admin/src/Controller/Custom_codeController.php
+++ b/admin/src/Controller/Custom_codeController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class Custom_codeController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Custom Code.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Custom Code.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Custom Code.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_CUSTOM_CODE') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('CustomCode.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CUSTOM_CODE_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('custom_code.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('custom_code', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CUSTOM_CODE_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CUSTOM_CODE_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CUSTOM_CODE_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=custom_code'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Custom Code.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Custom Code.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Custom Code.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_CUSTOM_CODE') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('CustomCode.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_CUSTOM_CODE_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('custom_code.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('custom_code', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_CUSTOM_CODE_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CUSTOM_CODE_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CUSTOM_CODE_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=custom_code'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class Custom_codeController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Custom_code', '', []);
@@ -281,6 +505,15 @@ class Custom_codeController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class Custom_codeController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('custom_code.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Custom_codesController.php b/admin/src/Controller/Custom_codesController.php
index ac595f6cd..df741f38e 100644
--- a/admin/src/Controller/Custom_codesController.php
+++ b/admin/src/Controller/Custom_codesController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class Custom_codesController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_CUSTOM_CODES') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('custom_code.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=CustomCode&target=Custom Codes', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_codes', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Custom Codes.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Custom Codes.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Custom Codes.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_codes', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('custom_code.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('CustomCode.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['custom_code'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('custom_code', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CUSTOM_CODES_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_CUSTOM_CODES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_CUSTOM_CODES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_codes', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_codes', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Custom Codes.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Custom Codes.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Custom Codes.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_codes', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('custom_code.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('CustomCode.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['custom_code'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('custom_code', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_CUSTOM_CODES_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CUSTOM_CODES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_CUSTOM_CODES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_codes', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=custom_codes', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/Dynamic_getController.php b/admin/src/Controller/Dynamic_getController.php
index 11eca111e..b3073c2cf 100644
--- a/admin/src/Controller/Dynamic_getController.php
+++ b/admin/src/Controller/Dynamic_getController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class Dynamic_getController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Dynamic Get.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Dynamic Get.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Dynamic Get.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_DYNAMIC_GET') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('DynamicGet.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_DYNAMIC_GET_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('dynamic_get.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('dynamic_get', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_DYNAMIC_GET_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_DYNAMIC_GET_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_DYNAMIC_GET_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=dynamic_get'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Dynamic Get.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Dynamic Get.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Dynamic Get.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_DYNAMIC_GET') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('DynamicGet.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_DYNAMIC_GET_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('dynamic_get.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('dynamic_get', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_DYNAMIC_GET_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_DYNAMIC_GET_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_DYNAMIC_GET_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=dynamic_get'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class Dynamic_getController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Dynamic_get', '', []);
@@ -281,6 +505,15 @@ class Dynamic_getController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class Dynamic_getController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('dynamic_get.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Dynamic_getsController.php b/admin/src/Controller/Dynamic_getsController.php
index 8a5b26c07..27f26428f 100644
--- a/admin/src/Controller/Dynamic_getsController.php
+++ b/admin/src/Controller/Dynamic_getsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class Dynamic_getsController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_DYNAMIC_GETS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('dynamic_get.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=DynamicGet&target=Dynamic Gets', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Dynamic Gets.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Dynamic Gets.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Dynamic Gets.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('dynamic_get.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('DynamicGet.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['dynamic_get'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('dynamic_get', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_DYNAMIC_GETS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_DYNAMIC_GETS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_DYNAMIC_GETS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Dynamic Gets.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Dynamic Gets.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Dynamic Gets.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('dynamic_get.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('DynamicGet.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['dynamic_get'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('dynamic_get', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_DYNAMIC_GETS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_DYNAMIC_GETS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_DYNAMIC_GETS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/FieldController.php b/admin/src/Controller/FieldController.php
index acbfae439..80a5544de 100644
--- a/admin/src/Controller/FieldController.php
+++ b/admin/src/Controller/FieldController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class FieldController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Field.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Field.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Field.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_FIELD') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Field.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_FIELD_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('field.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('field', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_FIELD_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_FIELD_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_FIELD_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=field'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Field.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Field.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Field.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_FIELD') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Field.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_FIELD_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('field.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('field', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_FIELD_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_FIELD_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_FIELD_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=field'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -216,7 +440,7 @@ class FieldController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Field', '', []);
@@ -280,6 +504,15 @@ class FieldController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -362,6 +595,15 @@ class FieldController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('field.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/FieldsController.php b/admin/src/Controller/FieldsController.php
index 29a3e8e40..491c5278c 100644
--- a/admin/src/Controller/FieldsController.php
+++ b/admin/src/Controller/FieldsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class FieldsController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_FIELDS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('field.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Field&target=Fields', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fields', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Fields.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Fields.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Fields.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fields', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('field.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Field.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['field'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('field', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_FIELDS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_FIELDS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_FIELDS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fields', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fields', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Fields.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Fields.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Fields.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fields', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('field.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Field.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['field'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('field', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_FIELDS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_FIELDS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_FIELDS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fields', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fields', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/FieldtypeController.php b/admin/src/Controller/FieldtypeController.php
index df9596c02..0f3bb4172 100644
--- a/admin/src/Controller/FieldtypeController.php
+++ b/admin/src/Controller/FieldtypeController.php
@@ -93,6 +93,7 @@ class FieldtypeController extends FormController
* 7. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful reset, false on failure.
+ * @since 5.1.1
*/
public function resetPowers()
{
@@ -103,7 +104,7 @@ class FieldtypeController extends FormController
$item = $this->input->post->get('jform', array(), 'array');
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -111,9 +112,12 @@ class FieldtypeController extends FormController
$status = 'error';
$success = false;
+ // get the guid field of this entity
+ $key_field = FieldtypeFactory::_('Joomla.Fieldtype.Remote.Get')->getGuidField();
+
// load the ID
$id = $item['id'] ?? null;
- $guid = $item['guid'] ?? null;
+ $guid = $item[$key_field] ?? null;
// check if there is any selections
if ($id === null || $guid === null)
@@ -128,8 +132,8 @@ class FieldtypeController extends FormController
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Get')->reset([$guid]))
{
// set success message
- $message = '
'.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= '
'.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_FIELD_TYPE_HAS_SUCCESSFULLY_BEEN_RESET').'
';
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_FIELD_TYPE_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
$status = 'success';
$success = true;
}
@@ -147,7 +151,7 @@ class FieldtypeController extends FormController
// set redirect
$redirect_url = Route::_(
'index.php?option=com_componentbuilder&view=fieldtype'
- . $this->getRedirectToItemAppend($id), $success
+ . $this->getRedirectToItemAppend($id), false
);
$this->setRedirect($redirect_url, $message, $status);
@@ -168,6 +172,7 @@ class FieldtypeController extends FormController
* 7. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful push, false on failure.
+ * @since 5.1.1
*/
public function pushPowers()
{
@@ -178,7 +183,7 @@ class FieldtypeController extends FormController
$item = $this->input->post->get('jform', array(), 'array');
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -186,9 +191,14 @@ class FieldtypeController extends FormController
$status = 'error';
$success = false;
+ // get the guid field of this entity
+ $key_field = FieldtypeFactory::_('Joomla.Fieldtype.Remote.Set')->getGuidField();
+
// load the ID
$id = $item['id'] ?? null;
- $guid = $item['guid'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['warning', 'error'];
// check if there is any selections
if ($id === null || $guid === null)
@@ -203,15 +213,50 @@ class FieldtypeController extends FormController
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Set')->items([$guid]))
{
// set success message
- $message = '
'.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= '
'.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_FIELD_TYPE_HAS_SUCCESSFULLY_BEEN_PUSHED').'
';
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_FIELD_TYPE_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
$status = 'success';
$success = true;
}
else
{
+ // Load any messages from the message bus
+ $message_bucket = [];
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = FieldtypeFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $message_bucket[$message_key] = $messages;
+ }
+ }
+
+ // Initialize base values
$message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
$message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_FIELD_TYPE_HAS_FAILED') . '
';
+ $status = 'error';
+
+ // Handle both error and warning
+ if (isset($message_bucket['error'], $message_bucket['warning']))
+ {
+ $message .= '
' . implode(' ', $message_bucket['error']) . '
';
+
+ foreach ($message_bucket['warning'] as $warning)
+ {
+ $this->app->enqueueMessage($warning, 'warning');
+ }
+ }
+ elseif (isset($message_bucket['error']))
+ {
+ $message .= '
' . implode(' ', $message_bucket['error']) . '
';
+ }
+ elseif (isset($message_bucket['warning']))
+ {
+ $status = 'warning';
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_FIELD_TYPE_COULD_NOT_BE_COMPLETED') . '
';
+ $message .= '
' . implode(' ', $message_bucket['warning']) . '
';
+ }
}
} catch (\Exception $e) {
$message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
@@ -222,7 +267,7 @@ class FieldtypeController extends FormController
// set redirect
$redirect_url = Route::_(
'index.php?option=com_componentbuilder&view=fieldtype'
- . $this->getRedirectToItemAppend($id), $success
+ . $this->getRedirectToItemAppend($id), false
);
$this->setRedirect($redirect_url, $message, $status);
@@ -368,7 +413,7 @@ class FieldtypeController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Fieldtype', '', []);
@@ -432,6 +477,15 @@ class FieldtypeController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -514,6 +568,15 @@ class FieldtypeController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('fieldtype.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/FieldtypesController.php b/admin/src/Controller/FieldtypesController.php
index adb1e5465..e75293b91 100644
--- a/admin/src/Controller/FieldtypesController.php
+++ b/admin/src/Controller/FieldtypesController.php
@@ -18,7 +18,6 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Componentbuilder\Fieldtype\Factory as FieldtypeFactory;
-use VDM\Joomla\Utilities\GetHelper;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -56,16 +55,10 @@ class FieldtypesController extends AdminController
/**
- * Initializes all remote Joomla Field Types and syncs them with the local database.
- *
- * This function performs several checks and operations:
- * 1. It verifies the authenticity of the request to prevent request forgery.
- * 2. It checks whether the current user has the necessary permissions to initialize the Joomla Field Types.
- * 3. If the user is authorized, it attempts to initialize the remote Joomla Field Types.
- * 4. Depending on the result of the initialization operation, it sets the appropriate success or error message.
- * 5. It redirects the user to a specified URL with the result message and status.
+ * Redirect the request to the Initialization selection page.
*
* @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
*/
public function initPowers()
{
@@ -73,7 +66,7 @@ class FieldtypesController extends AdminController
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '
' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -83,29 +76,20 @@ class FieldtypesController extends AdminController
if($user->authorise('fieldtype.init', 'com_componentbuilder'))
{
- try {
- if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Get')->init())
- {
- // set success message
- $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_JOOMLA_FIELD_TYPES') . ' ';
- $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_JOOMLA_FIELD_TYPES_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '
';
+ // set success message
+ $message = null;
- $status = 'success';
- $success = true;
- }
- else
- {
- $message = '
' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . ' ';
- $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_JOOMLA_FIELD_TYPES_HAS_FAILED') . '
';
- }
- } catch (\Exception $e) {
- $message = '
' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . ' ';
- $message .= '
' . \htmlspecialchars($e->getMessage()) . '
';
- }
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Joomla.Fieldtype&target=Joomla Field Types', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
}
-
- // set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', $success);
$this->setRedirect($redirect_url, $message, $status);
return $success;
@@ -125,6 +109,7 @@ class FieldtypesController extends AdminController
* 8. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful reset, false on failure.
+ * @since 5.1.1
*/
public function resetPowers()
{
@@ -141,8 +126,8 @@ class FieldtypesController extends AdminController
if ($pks === [])
{
// set error message
- $message = '
'.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').' ';
- $message .= '
'.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'
';
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
$this->setRedirect($redirect_url, $message, 'error');
@@ -153,17 +138,19 @@ class FieldtypesController extends AdminController
$success = false;
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
if($user->authorise('fieldtype.reset', 'com_componentbuilder'))
{
- $guids = GetHelper::vars('fieldtype', $pks, 'id', 'guid');
+ // get the guid field of this entity
+ $key_field = FieldtypeFactory::_('Joomla.Fieldtype.Remote.Get')->getGuidField();
+ $guids = FieldtypeFactory::_('Load')->values([$key_field], ['fieldtype'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
try {
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Get')->reset($guids))
{
// set success message
- $message = '
'.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= '
'.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_FIELD_TYPES_HAVE_SUCCESSFULLY_BEEN_RESET').'
';
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_FIELD_TYPES_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
$status = 'success';
$success = true;
}
@@ -178,7 +165,7 @@ class FieldtypesController extends AdminController
}
// set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', $success);
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
$this->setRedirect($redirect_url, $message, $status);
return $success;
@@ -204,6 +191,7 @@ class FieldtypesController extends AdminController
* 8. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful push, false on failure.
+ * @since 5.1.1
*/
public function pushPowers()
{
@@ -220,8 +208,8 @@ class FieldtypesController extends AdminController
if ($pks === [])
{
// set error message
- $message = '
'.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').' ';
- $message .= '
'.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'
';
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
$this->setRedirect($redirect_url, $message, 'error');
@@ -230,26 +218,64 @@ class FieldtypesController extends AdminController
$status = 'error';
$success = false;
+ $message_bus = ['warning', 'error'];
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
if($user->authorise('fieldtype.push', 'com_componentbuilder'))
{
- $guids = GetHelper::vars('fieldtype', $pks, 'id', 'guid');
+ // get the guid field of this entity
+ $key_field = FieldtypeFactory::_('Joomla.Fieldtype.Remote.Set')->getGuidField();
+ $guids = FieldtypeFactory::_('Load')->values([$key_field], ['fieldtype'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
try {
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Set')->items($guids))
{
// set success message
- $message = '
'.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= '
'.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_FIELD_TYPES_HAVE_SUCCESSFULLY_BEEN_PUSHED').'
';
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_FIELD_TYPES_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
$status = 'success';
$success = true;
}
else
{
+ // Load any messages from the message bus
+ $message_bucket = [];
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = FieldtypeFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $message_bucket[$message_key] = $messages;
+ }
+ }
+
+ // Initialize base values
$message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
- $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_FIELD_TYPES_HAS_FAILED') . '
';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_FIELD_TYPES_HAS_FAILED') . '
';
+ $status = 'error';
+
+ // Handle both error and warning
+ if (isset($message_bucket['error'], $message_bucket['warning']))
+ {
+ $message .= '
' . implode(' ', $message_bucket['error']) . '
';
+
+ foreach ($message_bucket['warning'] as $warning)
+ {
+ $this->app->enqueueMessage($warning, 'warning');
+ }
+ }
+ elseif (isset($message_bucket['error']))
+ {
+ $message .= '
' . implode(' ', $message_bucket['error']) . '
';
+ }
+ elseif (isset($message_bucket['warning']))
+ {
+ $status = 'warning';
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . ' ';
+ $message .= '
' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_FIELD_TYPES_COULD_NOT_BE_COMPLETED') . '
';
+ $message .= '
' . implode(' ', $message_bucket['warning']) . '
';
+ }
}
} catch (\Exception $e) {
$message = '
' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
@@ -257,7 +283,7 @@ class FieldtypesController extends AdminController
}
// set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', $success);
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
$this->setRedirect($redirect_url, $message, $status);
return $success;
diff --git a/admin/src/Controller/Get_snippetsController.php b/admin/src/Controller/Get_snippetsController.php
deleted file mode 100644
index b84c5be03..000000000
--- a/admin/src/Controller/Get_snippetsController.php
+++ /dev/null
@@ -1,120 +0,0 @@
-
- * @git Joomla Component Builder
- * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- */
-namespace VDM\Component\Componentbuilder\Administrator\Controller;
-
-use Joomla\CMS\Factory;
-use Joomla\CMS\Language\Text;
-use Joomla\CMS\MVC\Controller\AdminController;
-use Joomla\Utilities\ArrayHelper;
-use Joomla\CMS\Router\Route;
-use Joomla\CMS\Session\Session;
-use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-
-// No direct access to this file
-\defined('_JEXEC') or die;
-
-/**
- * Get_snippets Admin Controller
- *
- * @since 1.6
- */
-class Get_snippetsController extends AdminController
-{
- /**
- * The prefix to use with controller messages.
- *
- * @var string
- * @since 1.6
- */
- protected $text_prefix = 'COM_COMPONENTBUILDER_GET_SNIPPETS';
-
- /**
- * Proxy for getModel.
- *
- * @param string $name The model name. Optional.
- * @param string $prefix The class prefix. Optional.
- * @param array $config Configuration array for model. Optional.
- *
- * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel
- *
- * @since 1.6
- */
- public function getModel($name = '###View###', $prefix = 'Administrator', $config = ['ignore_request' => true])
- {
- return parent::getModel($name, $prefix, $config);
- }
-
- /**
- * Adds option to redirect back to the dashboard.
- *
- * @return void
- *
- * @since 3.0
- */
- public function dashboard(): void
- {
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder', false));
- }
-
- public function openLibraries()
- {
- // Check for request forgeries
- Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the libraries
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=libraries', false));
- return;
- }
-
- public function openSnippets()
- {
- // Check for request forgeries
- Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the snippets
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false));
- return;
- }
-
- public function openSiteViews()
- {
- // Check for request forgeries
- Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the site views
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=site_views', false));
- return;
- }
-
- public function openCustomAdminViews()
- {
- // Check for request forgeries
- Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the custom admin views
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false));
- return;
- }
-
- public function openTemplates()
- {
- // Check for request forgeries
- Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the templates
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=templates', false));
- return;
- }
-
- public function openLayouts()
- {
- // Check for request forgeries
- Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the layouts
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=layouts', false));
- return;
- }
-}
diff --git a/admin/src/Controller/Help_documentController.php b/admin/src/Controller/Help_documentController.php
index 1df9b54b9..cf00ecdb0 100644
--- a/admin/src/Controller/Help_documentController.php
+++ b/admin/src/Controller/Help_documentController.php
@@ -217,7 +217,7 @@ class Help_documentController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Help_document', '', []);
@@ -281,6 +281,15 @@ class Help_documentController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Help_documentController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('help_document.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Import_joomla_componentsimportController.php b/admin/src/Controller/Import_joomla_componentsimportController.php
index 59c5de64b..099272458 100644
--- a/admin/src/Controller/Import_joomla_componentsimportController.php
+++ b/admin/src/Controller/Import_joomla_componentsimportController.php
@@ -17,7 +17,6 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\Utilities\ArrayHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
diff --git a/admin/src/Controller/Initialization_selectionController.php b/admin/src/Controller/Initialization_selectionController.php
new file mode 100644
index 000000000..c678a3bc3
--- /dev/null
+++ b/admin/src/Controller/Initialization_selectionController.php
@@ -0,0 +1,57 @@
+
+ * @git Joomla Component Builder
+ * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+namespace VDM\Component\Componentbuilder\Administrator\Controller;
+
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\MVC\Controller\BaseController;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Session\Session;
+use Joomla\Utilities\ArrayHelper;
+use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+
+// No direct access to this file
+\defined('_JEXEC') or die;
+
+/**
+ * Componentbuilder Initialization_selection Base Controller
+ *
+ * @since 1.6
+ */
+class Initialization_selectionController extends BaseController
+{
+ /**
+ * The context for storing internal data, e.g. record.
+ *
+ * @var string
+ * @since 1.6
+ */
+ protected $context = 'initialization_selection';
+
+ /**
+ * The URL view item variable.
+ *
+ * @var string
+ * @since 1.6
+ */
+ protected $view_item = 'initialization_selection';
+
+ /**
+ * Adds option to redirect back to the dashboard.
+ *
+ * @return void
+ * @since 3.0
+ */
+ public function dashboard(): void
+ {
+ $this->setRedirect(Route::_('index.php?option=com_componentbuilder', false));
+ }
+}
diff --git a/admin/src/Controller/Joomla_componentController.php b/admin/src/Controller/Joomla_componentController.php
index fc1669e70..f24723b38 100644
--- a/admin/src/Controller/Joomla_componentController.php
+++ b/admin/src/Controller/Joomla_componentController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Data\Factory as DataFactory;
use VDM\Joomla\Utilities\GuidHelper;
@@ -80,6 +81,229 @@ class Joomla_componentController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Joomla Component.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Joomla Component.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Joomla Component.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_JOOMLA_COMPONENT') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Component.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_COMPONENT_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('joomla_component.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('joomla_component', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_COMPONENT_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_COMPONENT_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_COMPONENT_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=joomla_component'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Joomla Component.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Joomla Component.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Joomla Component.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_COMPONENT') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Component.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_COMPONENT_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('joomla_component.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('joomla_component', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_COMPONENT_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_COMPONENT_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_COMPONENT_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=joomla_component'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -219,7 +443,7 @@ class Joomla_componentController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_component', '', []);
@@ -283,6 +507,15 @@ class Joomla_componentController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -365,6 +598,15 @@ class Joomla_componentController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_component.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
// linked tables to update
$_tables_array = [
'component_admin_views' => 'joomla_component',
diff --git a/admin/src/Controller/Joomla_componentsController.php b/admin/src/Controller/Joomla_componentsController.php
index 2d7fbd49a..86d84b493 100644
--- a/admin/src/Controller/Joomla_componentsController.php
+++ b/admin/src/Controller/Joomla_componentsController.php
@@ -17,9 +17,9 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -160,5 +160,273 @@ class Joomla_componentsController extends AdminController
}
$this->setRedirect($redirect_url, $message, 'error');
return false;
+ }
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_JOOMLA_COMPONENTS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('joomla_component.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Component&target=Joomla Components', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_components', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Joomla Components.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Joomla Components.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Joomla Components.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_components', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('joomla_component.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Component.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['joomla_component'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('joomla_component', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_COMPONENTS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_COMPONENTS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_COMPONENTS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_components', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_components', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Joomla Components.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Joomla Components.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Joomla Components.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_components', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('joomla_component.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Component.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['joomla_component'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('joomla_component', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_COMPONENTS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_COMPONENTS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_COMPONENTS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_components', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_components', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
}
}
\ No newline at end of file
diff --git a/admin/src/Controller/Joomla_moduleController.php b/admin/src/Controller/Joomla_moduleController.php
index 9ddb03860..e8cfc9d6a 100644
--- a/admin/src/Controller/Joomla_moduleController.php
+++ b/admin/src/Controller/Joomla_moduleController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Data\Factory as DataFactory;
use VDM\Joomla\Utilities\GuidHelper;
@@ -80,6 +81,229 @@ class Joomla_moduleController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Joomla Module.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Joomla Module.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Joomla Module.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_JOOMLA_MODULE') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('JoomlaModule.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_MODULE_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('joomla_module.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('joomla_module', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_MODULE_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_MODULE_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_MODULE_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=joomla_module'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Joomla Module.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Joomla Module.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Joomla Module.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_MODULE') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('JoomlaModule.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_MODULE_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('joomla_module.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('joomla_module', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_MODULE_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_MODULE_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_MODULE_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=joomla_module'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -219,7 +443,7 @@ class Joomla_moduleController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_module', '', []);
@@ -283,6 +507,15 @@ class Joomla_moduleController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -365,6 +598,15 @@ class Joomla_moduleController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_module.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
// linked tables to update
$_tables_array = [
'joomla_module_updates' => 'joomla_module',
diff --git a/admin/src/Controller/Joomla_module_files_folders_urlsController.php b/admin/src/Controller/Joomla_module_files_folders_urlsController.php
index 3f9653eb8..0f238f0e7 100644
--- a/admin/src/Controller/Joomla_module_files_folders_urlsController.php
+++ b/admin/src/Controller/Joomla_module_files_folders_urlsController.php
@@ -217,7 +217,7 @@ class Joomla_module_files_folders_urlsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_module_files_folders_urls', '', []);
@@ -281,6 +281,15 @@ class Joomla_module_files_folders_urlsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Joomla_module_files_folders_urlsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_module_files_folders_urls.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Joomla_module_updatesController.php b/admin/src/Controller/Joomla_module_updatesController.php
index 13861ccf4..929cf2f09 100644
--- a/admin/src/Controller/Joomla_module_updatesController.php
+++ b/admin/src/Controller/Joomla_module_updatesController.php
@@ -220,7 +220,7 @@ class Joomla_module_updatesController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_module_updates', '', []);
@@ -284,6 +284,15 @@ class Joomla_module_updatesController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -366,6 +375,15 @@ class Joomla_module_updatesController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_module_updates.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
// update the component version to match the updated last version
if (isset($validData['joomla_plugin']) && GuidHelper::valid($validData['joomla_plugin']))
{
diff --git a/admin/src/Controller/Joomla_modulesController.php b/admin/src/Controller/Joomla_modulesController.php
index fc32e2341..4cd4d6ed6 100644
--- a/admin/src/Controller/Joomla_modulesController.php
+++ b/admin/src/Controller/Joomla_modulesController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class Joomla_modulesController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_JOOMLA_MODULES') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('joomla_module.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=JoomlaModule&target=Joomla Modules', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Joomla Modules.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Joomla Modules.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Joomla Modules.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('joomla_module.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('JoomlaModule.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['joomla_module'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('joomla_module', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_MODULES_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_MODULES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_MODULES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Joomla Modules.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Joomla Modules.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Joomla Modules.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('joomla_module.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('JoomlaModule.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['joomla_module'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('joomla_module', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_MODULES_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_MODULES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_MODULES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/Joomla_pluginController.php b/admin/src/Controller/Joomla_pluginController.php
index 4b5aaee95..64e0e6688 100644
--- a/admin/src/Controller/Joomla_pluginController.php
+++ b/admin/src/Controller/Joomla_pluginController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Data\Factory as DataFactory;
use VDM\Joomla\Utilities\GuidHelper;
@@ -80,6 +81,229 @@ class Joomla_pluginController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Joomla Plugin.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Joomla Plugin.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Joomla Plugin.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_JOOMLA_PLUGIN') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('JoomlaPlugin.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_PLUGIN_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('joomla_plugin.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('joomla_plugin', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_PLUGIN_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_PLUGIN_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_PLUGIN_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=joomla_plugin'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Joomla Plugin.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Joomla Plugin.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Joomla Plugin.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_PLUGIN') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('JoomlaPlugin.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_PLUGIN_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('joomla_plugin.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('joomla_plugin', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_PLUGIN_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_PLUGIN_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_PLUGIN_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=joomla_plugin'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -219,7 +443,7 @@ class Joomla_pluginController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_plugin', '', []);
@@ -283,6 +507,15 @@ class Joomla_pluginController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -365,6 +598,15 @@ class Joomla_pluginController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_plugin.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
// linked tables to update
$_tables_array = [
'joomla_plugin_updates' => 'joomla_plugin',
diff --git a/admin/src/Controller/Joomla_plugin_files_folders_urlsController.php b/admin/src/Controller/Joomla_plugin_files_folders_urlsController.php
index f68428065..5fc35a7a0 100644
--- a/admin/src/Controller/Joomla_plugin_files_folders_urlsController.php
+++ b/admin/src/Controller/Joomla_plugin_files_folders_urlsController.php
@@ -217,7 +217,7 @@ class Joomla_plugin_files_folders_urlsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_plugin_files_folders_urls', '', []);
@@ -281,6 +281,15 @@ class Joomla_plugin_files_folders_urlsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Joomla_plugin_files_folders_urlsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_plugin_files_folders_urls.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Joomla_plugin_groupController.php b/admin/src/Controller/Joomla_plugin_groupController.php
index 10e337ec7..41fd90fad 100644
--- a/admin/src/Controller/Joomla_plugin_groupController.php
+++ b/admin/src/Controller/Joomla_plugin_groupController.php
@@ -210,7 +210,7 @@ class Joomla_plugin_groupController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_plugin_group', '', []);
@@ -274,6 +274,15 @@ class Joomla_plugin_groupController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -356,6 +365,15 @@ class Joomla_plugin_groupController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_plugin_group.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Joomla_plugin_updatesController.php b/admin/src/Controller/Joomla_plugin_updatesController.php
index c6cc0165a..d399481b8 100644
--- a/admin/src/Controller/Joomla_plugin_updatesController.php
+++ b/admin/src/Controller/Joomla_plugin_updatesController.php
@@ -219,7 +219,7 @@ class Joomla_plugin_updatesController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_plugin_updates', '', []);
@@ -283,6 +283,15 @@ class Joomla_plugin_updatesController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -365,6 +374,15 @@ class Joomla_plugin_updatesController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_plugin_updates.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
// update the component version to match the updated last version
if (isset($validData['joomla_plugin']) && is_numeric($validData['joomla_plugin']) && $validData['joomla_plugin'] > 0)
{
diff --git a/admin/src/Controller/Joomla_pluginsController.php b/admin/src/Controller/Joomla_pluginsController.php
index b6d597244..68d4df991 100644
--- a/admin/src/Controller/Joomla_pluginsController.php
+++ b/admin/src/Controller/Joomla_pluginsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -54,54 +55,270 @@ class Joomla_pluginsController extends AdminController
/**
- * get Boilerplate
+ * Redirect the request to the Initialization selection page.
*
- * @return boolean
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
*/
- public function getBoilerplate()
+ public function initPowers()
{
// Check for request forgeries
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
// check if user has the right
- $user = Factory::getUser();
- // set page redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_plugins', false);
- // set massage
- $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_GET_BOILERPLATE_MODULE');
- // check if this user has the right to run expansion
- if($user->authorise('joomla_plugin.get_boilerplate', 'com_componentbuilder'))
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_JOOMLA_PLUGINS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('joomla_plugin.init', 'com_componentbuilder'))
{
- // set massage
- $message = Text::_('COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_FAILED_IF_THE_ISSUE_CONTINUES_INFORM_YOUR_SYSTEM_ADMINISTRATOR');
- // Get the model
- $model = $this->getModel('joomla_plugins');
- // check if there is any selections
- if (!$model->getBoilerplate())
- {
- $message = '' . Text::_('COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_WAS_SUCCESSFULLY') . ' ';
- $this->setRedirect($redirect_url, $message, 'message');
- return true;
- }
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=JoomlaPlugin&target=Joomla Plugins', false);
}
- $this->setRedirect($redirect_url, $message, 'error');
- return false;
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_plugins', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
}
- public function openClassMethods()
+ /**
+ * Resets the selected Joomla Plugins.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Joomla Plugins.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Joomla Plugins.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the libraries
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_methods', false));
- return;
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_plugins', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('joomla_plugin.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('JoomlaPlugin.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['joomla_plugin'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('joomla_plugin', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_PLUGINS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_PLUGINS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_PLUGINS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_plugins', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_plugins', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
}
- public function openClassProperties()
+ /**
+ * Pushes the selected Joomla Plugins.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Joomla Plugins.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Joomla Plugins.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the libraries
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_properties', false));
- return;
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_plugins', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('joomla_plugin.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('JoomlaPlugin.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['joomla_plugin'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('joomla_plugin', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_PLUGINS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_PLUGINS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_PLUGINS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_plugins', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_plugins', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
}
}
\ No newline at end of file
diff --git a/admin/src/Controller/Joomla_powerController.php b/admin/src/Controller/Joomla_powerController.php
index 27acd0a48..57adb2d8e 100644
--- a/admin/src/Controller/Joomla_powerController.php
+++ b/admin/src/Controller/Joomla_powerController.php
@@ -93,6 +93,7 @@ class Joomla_powerController extends FormController
* 7. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful reset, false on failure.
+ * @since 5.1.1
*/
public function resetPowers()
{
@@ -103,7 +104,7 @@ class Joomla_powerController extends FormController
$item = $this->input->post->get('jform', array(), 'array');
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -111,9 +112,12 @@ class Joomla_powerController extends FormController
$status = 'error';
$success = false;
+ // get the guid field of this entity
+ $key_field = JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->getGuidField();
+
// load the ID
$id = $item['id'] ?? null;
- $guid = $item['guid'] ?? null;
+ $guid = $item[$key_field] ?? null;
// check if there is any selections
if ($id === null || $guid === null)
@@ -128,8 +132,8 @@ class Joomla_powerController extends FormController
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->reset([$guid]))
{
// set success message
- $message = ''.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_RESET').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
$status = 'success';
$success = true;
}
@@ -147,7 +151,7 @@ class Joomla_powerController extends FormController
// set redirect
$redirect_url = Route::_(
'index.php?option=com_componentbuilder&view=joomla_power'
- . $this->getRedirectToItemAppend($id), $success
+ . $this->getRedirectToItemAppend($id), false
);
$this->setRedirect($redirect_url, $message, $status);
@@ -168,6 +172,7 @@ class Joomla_powerController extends FormController
* 7. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful push, false on failure.
+ * @since 5.1.1
*/
public function pushPowers()
{
@@ -178,7 +183,7 @@ class Joomla_powerController extends FormController
$item = $this->input->post->get('jform', array(), 'array');
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -186,9 +191,14 @@ class Joomla_powerController extends FormController
$status = 'error';
$success = false;
+ // get the guid field of this entity
+ $key_field = JoomlaPowerFactory::_('Joomla.Power.Remote.Set')->getGuidField();
+
// load the ID
$id = $item['id'] ?? null;
- $guid = $item['guid'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['warning', 'error'];
// check if there is any selections
if ($id === null || $guid === null)
@@ -203,15 +213,50 @@ class Joomla_powerController extends FormController
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Set')->items([$guid]))
{
// set success message
- $message = ''.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
$status = 'success';
$success = true;
}
else
{
+ // Load any messages from the message bus
+ $message_bucket = [];
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = JoomlaPowerFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $message_bucket[$message_key] = $messages;
+ }
+ }
+
+ // Initialize base values
$message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
$message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_POWER_HAS_FAILED') . '
';
+ $status = 'error';
+
+ // Handle both error and warning
+ if (isset($message_bucket['error'], $message_bucket['warning']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+
+ foreach ($message_bucket['warning'] as $warning)
+ {
+ $this->app->enqueueMessage($warning, 'warning');
+ }
+ }
+ elseif (isset($message_bucket['error']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+ }
+ elseif (isset($message_bucket['warning']))
+ {
+ $status = 'warning';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_POWER_COULD_NOT_BE_COMPLETED') . '
';
+ $message .= '' . implode(' ', $message_bucket['warning']) . '
';
+ }
}
} catch (\Exception $e) {
$message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
@@ -222,7 +267,7 @@ class Joomla_powerController extends FormController
// set redirect
$redirect_url = Route::_(
'index.php?option=com_componentbuilder&view=joomla_power'
- . $this->getRedirectToItemAppend($id), $success
+ . $this->getRedirectToItemAppend($id), false
);
$this->setRedirect($redirect_url, $message, $status);
@@ -369,7 +414,7 @@ class Joomla_powerController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Joomla_power', '', []);
@@ -433,6 +478,15 @@ class Joomla_powerController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -515,6 +569,15 @@ class Joomla_powerController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('joomla_power.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Joomla_powersController.php b/admin/src/Controller/Joomla_powersController.php
index f2a4503a3..0d23397e6 100644
--- a/admin/src/Controller/Joomla_powersController.php
+++ b/admin/src/Controller/Joomla_powersController.php
@@ -18,7 +18,6 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Componentbuilder\JoomlaPower\Factory as JoomlaPowerFactory;
-use VDM\Joomla\Utilities\GetHelper;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -56,16 +55,10 @@ class Joomla_powersController extends AdminController
/**
- * Initializes all remote Joomla Powers and syncs them with the local database.
- *
- * This function performs several checks and operations:
- * 1. It verifies the authenticity of the request to prevent request forgery.
- * 2. It checks whether the current user has the necessary permissions to initialize the Joomla Powers.
- * 3. If the user is authorized, it attempts to initialize the remote Joomla Powers.
- * 4. Depending on the result of the initialization operation, it sets the appropriate success or error message.
- * 5. It redirects the user to a specified URL with the result message and status.
+ * Redirect the request to the Initialization selection page.
*
* @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
*/
public function initPowers()
{
@@ -73,7 +66,7 @@ class Joomla_powersController extends AdminController
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -83,29 +76,20 @@ class Joomla_powersController extends AdminController
if($user->authorise('joomla_power.init', 'com_componentbuilder'))
{
- try {
- if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->init())
- {
- // set success message
- $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_JOOMLA_POWERS') . ' ';
- $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_JOOMLA_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '
';
+ // set success message
+ $message = null;
- $status = 'success';
- $success = true;
- }
- else
- {
- $message = '' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . ' ';
- $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_JOOMLA_POWERS_HAS_FAILED') . '
';
- }
- } catch (\Exception $e) {
- $message = '' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . ' ';
- $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
- }
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Joomla.Power&target=Joomla Powers', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', false);
}
-
- // set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', $success);
$this->setRedirect($redirect_url, $message, $status);
return $success;
@@ -125,6 +109,7 @@ class Joomla_powersController extends AdminController
* 8. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful reset, false on failure.
+ * @since 5.1.1
*/
public function resetPowers()
{
@@ -141,8 +126,8 @@ class Joomla_powersController extends AdminController
if ($pks === [])
{
// set error message
- $message = ''.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', false);
$this->setRedirect($redirect_url, $message, 'error');
@@ -153,17 +138,19 @@ class Joomla_powersController extends AdminController
$success = false;
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
if($user->authorise('joomla_power.reset', 'com_componentbuilder'))
{
- $guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid');
+ // get the guid field of this entity
+ $key_field = JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->getGuidField();
+ $guids = JoomlaPowerFactory::_('Load')->values([$key_field], ['joomla_power'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
try {
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->reset($guids))
{
// set success message
- $message = ''.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
$status = 'success';
$success = true;
}
@@ -178,7 +165,7 @@ class Joomla_powersController extends AdminController
}
// set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', $success);
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', false);
$this->setRedirect($redirect_url, $message, $status);
return $success;
@@ -204,6 +191,7 @@ class Joomla_powersController extends AdminController
* 8. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful push, false on failure.
+ * @since 5.1.1
*/
public function pushPowers()
{
@@ -220,8 +208,8 @@ class Joomla_powersController extends AdminController
if ($pks === [])
{
// set error message
- $message = ''.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', false);
$this->setRedirect($redirect_url, $message, 'error');
@@ -230,26 +218,64 @@ class Joomla_powersController extends AdminController
$status = 'error';
$success = false;
+ $message_bus = ['warning', 'error'];
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
if($user->authorise('joomla_power.push', 'com_componentbuilder'))
{
- $guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid');
+ // get the guid field of this entity
+ $key_field = JoomlaPowerFactory::_('Joomla.Power.Remote.Set')->getGuidField();
+ $guids = JoomlaPowerFactory::_('Load')->values([$key_field], ['joomla_power'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
try {
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Set')->items($guids))
{
// set success message
- $message = ''.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
$status = 'success';
$success = true;
}
else
{
+ // Load any messages from the message bus
+ $message_bucket = [];
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = JoomlaPowerFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $message_bucket[$message_key] = $messages;
+ }
+ }
+
+ // Initialize base values
$message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
- $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_POWERS_HAS_FAILED') . '
';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_POWERS_HAS_FAILED') . '
';
+ $status = 'error';
+
+ // Handle both error and warning
+ if (isset($message_bucket['error'], $message_bucket['warning']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+
+ foreach ($message_bucket['warning'] as $warning)
+ {
+ $this->app->enqueueMessage($warning, 'warning');
+ }
+ }
+ elseif (isset($message_bucket['error']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+ }
+ elseif (isset($message_bucket['warning']))
+ {
+ $status = 'warning';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_POWERS_COULD_NOT_BE_COMPLETED') . '
';
+ $message .= '' . implode(' ', $message_bucket['warning']) . '
';
+ }
}
} catch (\Exception $e) {
$message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
@@ -257,7 +283,7 @@ class Joomla_powersController extends AdminController
}
// set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', $success);
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_powers', false);
$this->setRedirect($redirect_url, $message, $status);
return $success;
diff --git a/admin/src/Controller/LanguageController.php b/admin/src/Controller/LanguageController.php
index 48f337e5a..583088635 100644
--- a/admin/src/Controller/LanguageController.php
+++ b/admin/src/Controller/LanguageController.php
@@ -217,7 +217,7 @@ class LanguageController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Language', '', []);
@@ -281,6 +281,15 @@ class LanguageController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class LanguageController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('language.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Language_translationController.php b/admin/src/Controller/Language_translationController.php
index 18bd4d593..deade91ee 100644
--- a/admin/src/Controller/Language_translationController.php
+++ b/admin/src/Controller/Language_translationController.php
@@ -217,7 +217,7 @@ class Language_translationController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Language_translation', '', []);
@@ -281,6 +281,15 @@ class Language_translationController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Language_translationController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('language_translation.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/LayoutController.php b/admin/src/Controller/LayoutController.php
index 3a4c9adb5..e21e12f97 100644
--- a/admin/src/Controller/LayoutController.php
+++ b/admin/src/Controller/LayoutController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class LayoutController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Layout.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Layout.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Layout.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_LAYOUT') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Layout.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_LAYOUT_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('layout.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('layout', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_LAYOUT_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_LAYOUT_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_LAYOUT_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=layout'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Layout.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Layout.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Layout.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_LAYOUT') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Layout.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_LAYOUT_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('layout.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('layout', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_LAYOUT_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_LAYOUT_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_LAYOUT_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=layout'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class LayoutController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Layout', '', []);
@@ -281,6 +505,15 @@ class LayoutController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class LayoutController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('layout.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/LayoutsController.php b/admin/src/Controller/LayoutsController.php
index 88b164380..98a82ab51 100644
--- a/admin/src/Controller/LayoutsController.php
+++ b/admin/src/Controller/LayoutsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -52,12 +53,272 @@ class LayoutsController extends AdminController
return parent::getModel($name, $prefix, $config);
}
- public function getSnippets()
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the import snippets custom admin view
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false));
- return;
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_LAYOUTS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('layout.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Layout&target=Layouts', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=layouts', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Layouts.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Layouts.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Layouts.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=layouts', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('layout.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Layout.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['layout'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('layout', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_LAYOUTS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_LAYOUTS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_LAYOUTS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=layouts', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=layouts', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Layouts.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Layouts.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Layouts.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=layouts', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('layout.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Layout.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['layout'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('layout', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_LAYOUTS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_LAYOUTS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_LAYOUTS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=layouts', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=layouts', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
}
}
\ No newline at end of file
diff --git a/admin/src/Controller/LibrariesController.php b/admin/src/Controller/LibrariesController.php
index 86a15a656..93a15f7ff 100644
--- a/admin/src/Controller/LibrariesController.php
+++ b/admin/src/Controller/LibrariesController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -52,12 +53,272 @@ class LibrariesController extends AdminController
return parent::getModel($name, $prefix, $config);
}
- public function getSnippets()
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the import snippets custom admin view
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false));
- return;
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_LIBRARIES') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('library.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Library&target=Libraries', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=libraries', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Libraries.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Libraries.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Libraries.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=libraries', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('library.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Library.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['library'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('library', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_LIBRARIES_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_LIBRARIES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_LIBRARIES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=libraries', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=libraries', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Libraries.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Libraries.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Libraries.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=libraries', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('library.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Library.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['library'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('library', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_LIBRARIES_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_LIBRARIES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_LIBRARIES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=libraries', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=libraries', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
}
}
\ No newline at end of file
diff --git a/admin/src/Controller/LibraryController.php b/admin/src/Controller/LibraryController.php
index 66318fc50..bcf7bb14f 100644
--- a/admin/src/Controller/LibraryController.php
+++ b/admin/src/Controller/LibraryController.php
@@ -24,8 +24,9 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use VDM\Joomla\Data\Factory as DataFactory;
use VDM\Joomla\Utilities\GuidHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
+use VDM\Joomla\Data\Factory as DataFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -80,6 +81,273 @@ class LibraryController extends FormController
*/
protected int $refid;
+
+ /**
+ * Method to edit an existing record.
+ *
+ * @param string $key The name of the primary key of the URL variable.
+ * @param string $urlVar The name of the URL variable if different from the primary key
+ * (sometimes required to avoid router collisions).
+ *
+ * @return boolean True if access level check and checkout passes, false otherwise.
+ *
+ * @since 1.6
+ */
+ public function edit($key = null, $urlVar = null)
+ {
+ // for modal title key selection (unique key to do mapping)
+ $titleKey = $this->input->get('titleKey', 'id', 'word');
+ $guid = null;
+ $value = null;
+
+ // Determine the name of the primary key for the data.
+ if (empty($key))
+ {
+ $model = $this->getModel();
+ $table = $model->getTable();
+ $key = $table->getKeyName();
+ }
+
+ if ($titleKey === 'guid')
+ {
+ $guid = $this->input->get('guid', null, 'string');
+ }
+
+ if ($guid !== null && GuidHelper::valid($guid))
+ {
+ $value = GuidHelper::item($guid, 'library', 'a.' . $key, 'componentbuilder');
+ }
+
+ if ($value !== null)
+ {
+ $this->input->set($key, $value);
+ }
+
+ return parent::edit($key, $urlVar);
+ }
+
+ /**
+ * Resets the specified Library.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Library.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Library.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_LIBRARY') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Library.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_LIBRARY_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('library.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('library', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_LIBRARY_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_LIBRARY_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_LIBRARY_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=library'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Library.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Library.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Library.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_LIBRARY') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Library.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_LIBRARY_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('library.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('library', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_LIBRARY_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_LIBRARY_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_LIBRARY_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=library'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -219,7 +487,7 @@ class LibraryController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Library', '', []);
@@ -283,6 +551,15 @@ class LibraryController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -365,6 +642,15 @@ class LibraryController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('library.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
// linked tables to update
$_tables_array = [
'library_config' => 'library',
diff --git a/admin/src/Controller/Library_configController.php b/admin/src/Controller/Library_configController.php
index 0d463e9b3..fdd20bd6d 100644
--- a/admin/src/Controller/Library_configController.php
+++ b/admin/src/Controller/Library_configController.php
@@ -217,7 +217,7 @@ class Library_configController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Library_config', '', []);
@@ -281,6 +281,15 @@ class Library_configController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Library_configController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('library_config.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Library_files_folders_urlsController.php b/admin/src/Controller/Library_files_folders_urlsController.php
index 3cc9ca66b..c49b471d8 100644
--- a/admin/src/Controller/Library_files_folders_urlsController.php
+++ b/admin/src/Controller/Library_files_folders_urlsController.php
@@ -217,7 +217,7 @@ class Library_files_folders_urlsController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Library_files_folders_urls', '', []);
@@ -281,6 +281,15 @@ class Library_files_folders_urlsController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Library_files_folders_urlsController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('library_files_folders_urls.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/PlaceholderController.php b/admin/src/Controller/PlaceholderController.php
index 636b69ab3..da59e31ac 100644
--- a/admin/src/Controller/PlaceholderController.php
+++ b/admin/src/Controller/PlaceholderController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class PlaceholderController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Placeholder.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Placeholder.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Placeholder.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_PLACEHOLDER') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Placeholder.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_PLACEHOLDER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('placeholder.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('placeholder', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PLACEHOLDER_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_PLACEHOLDER_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_PLACEHOLDER_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=placeholder'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Placeholder.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Placeholder.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Placeholder.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_PLACEHOLDER') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Placeholder.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_PLACEHOLDER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('placeholder.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('placeholder', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PLACEHOLDER_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_PLACEHOLDER_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_PLACEHOLDER_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=placeholder'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class PlaceholderController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Placeholder', '', []);
@@ -281,6 +505,15 @@ class PlaceholderController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class PlaceholderController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('placeholder.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/PlaceholdersController.php b/admin/src/Controller/PlaceholdersController.php
index 477f43492..10c05d97c 100644
--- a/admin/src/Controller/PlaceholdersController.php
+++ b/admin/src/Controller/PlaceholdersController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,273 @@ class PlaceholdersController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_PLACEHOLDERS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('placeholder.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Placeholder&target=Placeholders', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=placeholders', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Placeholders.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Placeholders.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Placeholders.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=placeholders', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('placeholder.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Placeholder.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['placeholder'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('placeholder', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_PLACEHOLDERS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_PLACEHOLDERS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_PLACEHOLDERS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=placeholders', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=placeholders', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Placeholders.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Placeholders.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Placeholders.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=placeholders', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('placeholder.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Placeholder.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['placeholder'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('placeholder', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_PLACEHOLDERS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_PLACEHOLDERS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_PLACEHOLDERS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=placeholders', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=placeholders', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/PowerController.php b/admin/src/Controller/PowerController.php
index d7c7c8bae..9d75972d6 100644
--- a/admin/src/Controller/PowerController.php
+++ b/admin/src/Controller/PowerController.php
@@ -93,6 +93,7 @@ class PowerController extends FormController
* 7. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful reset, false on failure.
+ * @since 5.1.1
*/
public function resetPowers()
{
@@ -103,7 +104,7 @@ class PowerController extends FormController
$item = $this->input->post->get('jform', array(), 'array');
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -111,9 +112,12 @@ class PowerController extends FormController
$status = 'error';
$success = false;
+ // get the guid field of this entity
+ $key_field = PowerFactory::_('Power.Remote.Get')->getGuidField();
+
// load the ID
$id = $item['id'] ?? null;
- $guid = $item['guid'] ?? null;
+ $guid = $item[$key_field] ?? null;
// check if there is any selections
if ($id === null || $guid === null)
@@ -128,8 +132,8 @@ class PowerController extends FormController
if (PowerFactory::_('Power.Remote.Get')->reset([$guid]))
{
// set success message
- $message = ''.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
$status = 'success';
$success = true;
}
@@ -147,7 +151,7 @@ class PowerController extends FormController
// set redirect
$redirect_url = Route::_(
'index.php?option=com_componentbuilder&view=power'
- . $this->getRedirectToItemAppend($id), $success
+ . $this->getRedirectToItemAppend($id), false
);
$this->setRedirect($redirect_url, $message, $status);
@@ -168,6 +172,7 @@ class PowerController extends FormController
* 7. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful push, false on failure.
+ * @since 5.1.1
*/
public function pushPowers()
{
@@ -178,7 +183,7 @@ class PowerController extends FormController
$item = $this->input->post->get('jform', array(), 'array');
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -186,9 +191,14 @@ class PowerController extends FormController
$status = 'error';
$success = false;
+ // get the guid field of this entity
+ $key_field = PowerFactory::_('Power.Remote.Set')->getGuidField();
+
// load the ID
$id = $item['id'] ?? null;
- $guid = $item['guid'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['warning', 'error'];
// check if there is any selections
if ($id === null || $guid === null)
@@ -203,15 +213,50 @@ class PowerController extends FormController
if (PowerFactory::_('Power.Remote.Set')->items([$guid]))
{
// set success message
- $message = ''.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
$status = 'success';
$success = true;
}
else
{
+ // Load any messages from the message bus
+ $message_bucket = [];
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PowerFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $message_bucket[$message_key] = $messages;
+ }
+ }
+
+ // Initialize base values
$message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
$message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWER_HAS_FAILED') . '
';
+ $status = 'error';
+
+ // Handle both error and warning
+ if (isset($message_bucket['error'], $message_bucket['warning']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+
+ foreach ($message_bucket['warning'] as $warning)
+ {
+ $this->app->enqueueMessage($warning, 'warning');
+ }
+ }
+ elseif (isset($message_bucket['error']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+ }
+ elseif (isset($message_bucket['warning']))
+ {
+ $status = 'warning';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWER_COULD_NOT_BE_COMPLETED') . '
';
+ $message .= '' . implode(' ', $message_bucket['warning']) . '
';
+ }
}
} catch (\Exception $e) {
$message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
@@ -222,7 +267,7 @@ class PowerController extends FormController
// set redirect
$redirect_url = Route::_(
'index.php?option=com_componentbuilder&view=power'
- . $this->getRedirectToItemAppend($id), $success
+ . $this->getRedirectToItemAppend($id), false
);
$this->setRedirect($redirect_url, $message, $status);
@@ -369,7 +414,7 @@ class PowerController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Power', '', []);
@@ -433,6 +478,15 @@ class PowerController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -515,6 +569,15 @@ class PowerController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('power.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/PowersController.php b/admin/src/Controller/PowersController.php
index 327760802..acf563994 100644
--- a/admin/src/Controller/PowersController.php
+++ b/admin/src/Controller/PowersController.php
@@ -18,7 +18,6 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Componentbuilder\Power\Factory as PowerFactory;
-use VDM\Joomla\Utilities\GetHelper;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -56,16 +55,10 @@ class PowersController extends AdminController
/**
- * Initializes all remote Powers and syncs them with the local database.
- *
- * This function performs several checks and operations:
- * 1. It verifies the authenticity of the request to prevent request forgery.
- * 2. It checks whether the current user has the necessary permissions to initialize the Powers.
- * 3. If the user is authorized, it attempts to initialize the remote Powers.
- * 4. Depending on the result of the initialization operation, it sets the appropriate success or error message.
- * 5. It redirects the user to a specified URL with the result message and status.
+ * Redirect the request to the Initialization selection page.
*
* @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
*/
public function initPowers()
{
@@ -73,7 +66,7 @@ class PowersController extends AdminController
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
// set default error message
$message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
@@ -83,29 +76,20 @@ class PowersController extends AdminController
if($user->authorise('power.init', 'com_componentbuilder'))
{
- try {
- if (PowerFactory::_('Power.Remote.Get')->init())
- {
- // set success message
- $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_POWERS') . ' ';
- $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '
';
+ // set success message
+ $message = null;
- $status = 'success';
- $success = true;
- }
- else
- {
- $message = '' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . ' ';
- $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED') . '
';
- }
- } catch (\Exception $e) {
- $message = '' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . ' ';
- $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
- }
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Power&target=Powers', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false);
}
-
- // set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', $success);
$this->setRedirect($redirect_url, $message, $status);
return $success;
@@ -125,6 +109,7 @@ class PowersController extends AdminController
* 8. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful reset, false on failure.
+ * @since 5.1.1
*/
public function resetPowers()
{
@@ -141,8 +126,8 @@ class PowersController extends AdminController
if ($pks === [])
{
// set error message
- $message = ''.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false);
$this->setRedirect($redirect_url, $message, 'error');
@@ -153,17 +138,19 @@ class PowersController extends AdminController
$success = false;
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
if($user->authorise('power.reset', 'com_componentbuilder'))
{
- $guids = GetHelper::vars('power', $pks, 'id', 'guid');
+ // get the guid field of this entity
+ $key_field = PowerFactory::_('Power.Remote.Get')->getGuidField();
+ $guids = PowerFactory::_('Load')->values([$key_field], ['power'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
try {
if (PowerFactory::_('Power.Remote.Get')->reset($guids))
{
// set success message
- $message = ''.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
$status = 'success';
$success = true;
}
@@ -178,7 +165,7 @@ class PowersController extends AdminController
}
// set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', $success);
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false);
$this->setRedirect($redirect_url, $message, $status);
return $success;
@@ -204,6 +191,7 @@ class PowersController extends AdminController
* 8. It redirects the user to a specified URL with the result message and status.
*
* @return bool True on successful push, false on failure.
+ * @since 5.1.1
*/
public function pushPowers()
{
@@ -220,8 +208,8 @@ class PowersController extends AdminController
if ($pks === [])
{
// set error message
- $message = ''.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
// set redirect
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false);
$this->setRedirect($redirect_url, $message, 'error');
@@ -230,26 +218,64 @@ class PowersController extends AdminController
$status = 'error';
$success = false;
+ $message_bus = ['warning', 'error'];
// check if user has the right
- $user = Factory::getUser();
+ $user = $this->app->getIdentity();
if($user->authorise('power.push', 'com_componentbuilder'))
{
- $guids = GetHelper::vars('power', $pks, 'id', 'guid');
+ // get the guid field of this entity
+ $key_field = PowerFactory::_('Power.Remote.Set')->getGuidField();
+ $guids = PowerFactory::_('Load')->values([$key_field], ['power'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
try {
if (PowerFactory::_('Power.Remote.Set')->items($guids))
{
// set success message
- $message = ''.Text::_('COM_COMPONENTBUILDER_SUCCESS').' ';
- $message .= ''.Text::_('COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED').'
';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
$status = 'success';
$success = true;
}
else
{
+ // Load any messages from the message bus
+ $message_bucket = [];
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PowerFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $message_bucket[$message_key] = $messages;
+ }
+ }
+
+ // Initialize base values
$message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
- $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_POWERS_HAS_FAILED') . '
';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWERS_HAS_FAILED') . '
';
+ $status = 'error';
+
+ // Handle both error and warning
+ if (isset($message_bucket['error'], $message_bucket['warning']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+
+ foreach ($message_bucket['warning'] as $warning)
+ {
+ $this->app->enqueueMessage($warning, 'warning');
+ }
+ }
+ elseif (isset($message_bucket['error']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+ }
+ elseif (isset($message_bucket['warning']))
+ {
+ $status = 'warning';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_POWERS_COULD_NOT_BE_COMPLETED') . '
';
+ $message .= '' . implode(' ', $message_bucket['warning']) . '
';
+ }
}
} catch (\Exception $e) {
$message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
@@ -257,7 +283,7 @@ class PowersController extends AdminController
}
// set redirect
- $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', $success);
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false);
$this->setRedirect($redirect_url, $message, $status);
return $success;
diff --git a/admin/src/Controller/RepositoriesController.php b/admin/src/Controller/RepositoriesController.php
index d6f4a17cc..8f8def145 100644
--- a/admin/src/Controller/RepositoriesController.php
+++ b/admin/src/Controller/RepositoriesController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Repository\Factory as RepositoryFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,4 +52,246 @@ class RepositoriesController extends AdminController
{
return parent::getModel($name, $prefix, $config);
}
+
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_REPOSITORIES') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('repository.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Repository&target=Repositories', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Repositories.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Repositories.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Repositories.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('repository.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = RepositoryFactory::_('Repository.Remote.Get')->getGuidField();
+ $guids = RepositoryFactory::_('Load')->values([$key_field], ['repository'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ if (RepositoryFactory::_('Repository.Remote.Get')->reset($guids))
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_REPOSITORIES_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ $success = true;
+ }
+ else
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_REPOSITORIES_HAS_FAILED') . '
';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
+ $this->setRedirect($redirect_url);
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Repositories.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Repositories.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Repositories.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $message_bus = ['warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('repository.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = RepositoryFactory::_('Repository.Remote.Set')->getGuidField();
+ $guids = RepositoryFactory::_('Load')->values([$key_field], ['repository'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ if (RepositoryFactory::_('Repository.Remote.Set')->items($guids))
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_REPOSITORIES_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ $success = true;
+ }
+ else
+ {
+ // Load any messages from the message bus
+ $message_bucket = [];
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = RepositoryFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $message_bucket[$message_key] = $messages;
+ }
+ }
+
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORIES_HAS_FAILED') . '
';
+ $status = 'error';
+
+ // Handle both error and warning
+ if (isset($message_bucket['error'], $message_bucket['warning']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+
+ foreach ($message_bucket['warning'] as $warning)
+ {
+ $this->app->enqueueMessage($warning, 'warning');
+ }
+ }
+ elseif (isset($message_bucket['error']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+ }
+ elseif (isset($message_bucket['warning']))
+ {
+ $status = 'warning';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_REPOSITORIES_COULD_NOT_BE_COMPLETED') . '
';
+ $message .= '' . implode(' ', $message_bucket['warning']) . '
';
+ }
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=repositories', false);
+ $this->setRedirect($redirect_url);
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/RepositoryController.php b/admin/src/Controller/RepositoryController.php
index 812a4e5c8..39deefa6e 100644
--- a/admin/src/Controller/RepositoryController.php
+++ b/admin/src/Controller/RepositoryController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Repository\Factory as RepositoryFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,202 @@ class RepositoryController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Repository.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Repository.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Repository.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_REPOSITORY') . '
';
+ $status = 'error';
+ $success = false;
+
+ // get the guid field of this entity
+ $key_field = RepositoryFactory::_('Repository.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_REPOSITORY_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('repository.reset', 'com_componentbuilder'))
+ {
+ try {
+ if (RepositoryFactory::_('Repository.Remote.Get')->reset([$guid]))
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_REPOSITORY_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ $success = true;
+ }
+ else
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_REPOSITORY_HAS_FAILED') . '
';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=repository'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Repository.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Repository.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Repository.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_REPOSITORY') . '
';
+ $status = 'error';
+ $success = false;
+
+ // get the guid field of this entity
+ $key_field = RepositoryFactory::_('Repository.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_REPOSITORY_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('repository.push', 'com_componentbuilder'))
+ {
+ try {
+ if (RepositoryFactory::_('Repository.Remote.Set')->items([$guid]))
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_REPOSITORY_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ $success = true;
+ }
+ else
+ {
+ // Load any messages from the message bus
+ $message_bucket = [];
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = RepositoryFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $message_bucket[$message_key] = $messages;
+ }
+ }
+
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORY_HAS_FAILED') . '
';
+ $status = 'error';
+
+ // Handle both error and warning
+ if (isset($message_bucket['error'], $message_bucket['warning']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+
+ foreach ($message_bucket['warning'] as $warning)
+ {
+ $this->app->enqueueMessage($warning, 'warning');
+ }
+ }
+ elseif (isset($message_bucket['error']))
+ {
+ $message .= '' . implode(' ', $message_bucket['error']) . '
';
+ }
+ elseif (isset($message_bucket['warning']))
+ {
+ $status = 'warning';
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_WAS_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_REPOSITORY_COULD_NOT_BE_COMPLETED') . '
';
+ $message .= '' . implode(' ', $message_bucket['warning']) . '
';
+ }
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=repository'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +414,7 @@ class RepositoryController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Repository', '', []);
@@ -281,6 +478,15 @@ class RepositoryController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +569,15 @@ class RepositoryController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('repository.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/ServerController.php b/admin/src/Controller/ServerController.php
index 36e368f4d..25b7e5927 100644
--- a/admin/src/Controller/ServerController.php
+++ b/admin/src/Controller/ServerController.php
@@ -217,7 +217,7 @@ class ServerController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Server', '', []);
@@ -281,6 +281,15 @@ class ServerController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class ServerController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('server.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Site_viewController.php b/admin/src/Controller/Site_viewController.php
index a23946ac2..8205a76b2 100644
--- a/admin/src/Controller/Site_viewController.php
+++ b/admin/src/Controller/Site_viewController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class Site_viewController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Site View.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Site View.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Site View.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_SITE_VIEW') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('SiteView.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_SITE_VIEW_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('site_view.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('site_view', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_SITE_VIEW_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SITE_VIEW_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SITE_VIEW_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=site_view'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Site View.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Site View.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Site View.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_SITE_VIEW') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('SiteView.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_SITE_VIEW_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('site_view.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('site_view', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_SITE_VIEW_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SITE_VIEW_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SITE_VIEW_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=site_view'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class Site_viewController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Site_view', '', []);
@@ -281,6 +505,15 @@ class Site_viewController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class Site_viewController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('site_view.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Site_viewsController.php b/admin/src/Controller/Site_viewsController.php
index d6df23b24..3634c7c58 100644
--- a/admin/src/Controller/Site_viewsController.php
+++ b/admin/src/Controller/Site_viewsController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -52,12 +53,272 @@ class Site_viewsController extends AdminController
return parent::getModel($name, $prefix, $config);
}
- public function getSnippets()
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the import snippets custom admin view
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false));
- return;
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_SITE_VIEWS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('site_view.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=SiteView&target=Site Views', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=site_views', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Site Views.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Site Views.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Site Views.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=site_views', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('site_view.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('SiteView.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['site_view'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('site_view', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_SITE_VIEWS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_SITE_VIEWS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SITE_VIEWS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=site_views', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=site_views', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Site Views.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Site Views.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Site Views.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=site_views', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('site_view.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('SiteView.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['site_view'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('site_view', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_SITE_VIEWS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SITE_VIEWS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SITE_VIEWS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=site_views', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=site_views', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
}
}
\ No newline at end of file
diff --git a/admin/src/Controller/SnippetController.php b/admin/src/Controller/SnippetController.php
index 9179d2bdd..50628aac4 100644
--- a/admin/src/Controller/SnippetController.php
+++ b/admin/src/Controller/SnippetController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Snippet\Factory as SnippetFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class SnippetController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Snippet.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Snippet.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Snippet.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_SNIPPET') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = SnippetFactory::_('Snippet.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_SNIPPET_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('snippet.reset', 'com_componentbuilder'))
+ {
+ try {
+ SnippetFactory::_('Package.Builder.Get')->reset('snippet', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = SnippetFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_SNIPPET_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SNIPPET_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SNIPPET_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=snippet'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Snippet.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Snippet.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Snippet.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_SNIPPET') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = SnippetFactory::_('Snippet.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_SNIPPET_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('snippet.push', 'com_componentbuilder'))
+ {
+ try {
+ SnippetFactory::_('Package.Builder.Set')->items('snippet', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = SnippetFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_SNIPPET_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SNIPPET_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SNIPPET_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=snippet'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class SnippetController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Snippet', '', []);
@@ -281,6 +505,15 @@ class SnippetController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class SnippetController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('snippet.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/Snippet_typeController.php b/admin/src/Controller/Snippet_typeController.php
index 11ab43e80..10c370701 100644
--- a/admin/src/Controller/Snippet_typeController.php
+++ b/admin/src/Controller/Snippet_typeController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Utilities\GuidHelper;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,51 @@ class Snippet_typeController extends FormController
*/
protected int $refid;
+
+ /**
+ * Method to edit an existing record.
+ *
+ * @param string $key The name of the primary key of the URL variable.
+ * @param string $urlVar The name of the URL variable if different from the primary key
+ * (sometimes required to avoid router collisions).
+ *
+ * @return boolean True if access level check and checkout passes, false otherwise.
+ *
+ * @since 1.6
+ */
+ public function edit($key = null, $urlVar = null)
+ {
+ // for modal title key selection (unique key to do mapping)
+ $titleKey = $this->input->get('titleKey', 'id', 'word');
+ $guid = null;
+ $value = null;
+
+ // Determine the name of the primary key for the data.
+ if (empty($key))
+ {
+ $model = $this->getModel();
+ $table = $model->getTable();
+ $key = $table->getKeyName();
+ }
+
+ if ($titleKey === 'guid')
+ {
+ $guid = $this->input->get('guid', null, 'string');
+ }
+
+ if ($guid !== null && GuidHelper::valid($guid))
+ {
+ $value = GuidHelper::item($guid, 'snippet_type', 'a.' . $key, 'componentbuilder');
+ }
+
+ if ($value !== null)
+ {
+ $this->input->set($key, $value);
+ }
+
+ return parent::edit($key, $urlVar);
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +263,7 @@ class Snippet_typeController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Snippet_type', '', []);
@@ -281,6 +327,15 @@ class Snippet_typeController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +418,15 @@ class Snippet_typeController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('snippet_type.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/SnippetsController.php b/admin/src/Controller/SnippetsController.php
index 9d4fc5bcb..bf9c66fdf 100644
--- a/admin/src/Controller/SnippetsController.php
+++ b/admin/src/Controller/SnippetsController.php
@@ -17,7 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
+use VDM\Joomla\Componentbuilder\Snippet\Factory as SnippetFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -53,76 +53,272 @@ class SnippetsController extends AdminController
return parent::getModel($name, $prefix, $config);
}
- public function getSnippets()
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the import snippets custom admin view
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false));
- return;
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_SNIPPETS') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('snippet.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Snippet&target=Snippets', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=snippets', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
}
- public function shareSnippets()
+ /**
+ * Resets the selected Snippets.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Snippets.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Snippets.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // Get the model
- $model = $this->getModel('snippets');
- // check if import is allowed for this user.
- $model->user = Factory::getUser();
- if ($model->user->authorise('snippet.import', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
- {
- // Get the input
- $input = Factory::getApplication()->input;
- $pks = $input->post->get('cid', array(), 'array');
- // Sanitize the input
- ArrayHelper::toInteger($pks);
- // check if there is any selections
- if (!UtilitiesArrayHelper::check($pks))
- {
- // Redirect to the list screen with error.
- $message = Text::_('COM_COMPONENTBUILDER_NO_SNIPPETS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN');
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error');
- return;
- }
- // set auto loader
- ComponentbuilderHelper::autoLoader('smart');
- // get the data to export
- if ($model->shareSnippets($pks))
- {
- // Message of successful build
- if (count($pks) > 1)
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=snippets', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('snippet.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = SnippetFactory::_('Snippet.Remote.Get')->getGuidField();
+ $guids = SnippetFactory::_('Load')->values([$key_field], ['snippet'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ SnippetFactory::_('Package.Builder.Get')->reset('snippet', $guids);
+
+ foreach ($message_bus as $message_key)
{
- $message = '' . Text::_('COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED') . ' ';
- $message .= '' . Text::sprintf('COM_COMPONENTBUILDER_TO_SHARE_THESE_SNIPPETS_WITH_THE_REST_OF_THE_JCB_COMMUNITY');
+ if (($messages = SnippetFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '
' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_SNIPPETS_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_SNIPPETS_HAS_FAILED') . '
';
+ $status = 'error';
}
else
{
- $message = '' . Text::_('COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED') . ' ';
- $message .= '' . Text::sprintf('COM_COMPONENTBUILDER_TO_SHARE_THIS_SNIPPET_WITH_THE_REST_OF_THE_JCB_COMMUNITY');
+ // Initialize base values
+ $message = '
' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_SNIPPETS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
}
- $message .= Text::sprintf('COM_COMPONENTBUILDER_YOU_WILL_NEED_TO_KNOW_HOW_S_WORKS_BASIC_YOU_WILL_ALSO_NEED_A_S_ACCOUNT_AND_KNOW_HOW_TO_MAKE_A_PULL_REQUEST_ON_GITHUB',
- 'git ',
- 'github.com ') . '';
-
- $message .= '' . Text::_('COM_COMPONENTBUILDER_NEED_HELP') . ' ';
- $message .= '';
- $message .= '' . Text::_('COM_COMPONENTBUILDER_ZIPPED_FILE_LOCATION') . ' ';
- $message .= '' . Text::sprintf('COM_COMPONENTBUILDER_PATH_CODESCODE', $model->zipPath). '
';
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false), $message);
- return;
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
}
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=snippets', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
}
- // Redirect to the list screen with error.
- $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_SHARE_THE_SNIPPETS_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP');
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error');
- return;
- }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=snippets', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Snippets.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Snippets.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Snippets.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=snippets', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('snippet.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = SnippetFactory::_('Snippet.Remote.Set')->getGuidField();
+ $guids = SnippetFactory::_('Load')->values([$key_field], ['snippet'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ SnippetFactory::_('Package.Builder.Set')->items('snippet', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = SnippetFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_SNIPPETS_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SNIPPETS_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_SNIPPETS_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=snippets', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=snippets', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
}
\ No newline at end of file
diff --git a/admin/src/Controller/TemplateController.php b/admin/src/Controller/TemplateController.php
index 1c1499a14..5bd3da50e 100644
--- a/admin/src/Controller/TemplateController.php
+++ b/admin/src/Controller/TemplateController.php
@@ -24,6 +24,7 @@ use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -78,6 +79,229 @@ class TemplateController extends FormController
*/
protected int $refid;
+
+ /**
+ * Resets the specified Template.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to reset the Template.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Template.
+ * 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_TEMPLATE') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Template.Remote.Get')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_RESET') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_TEMPLATE_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('template.reset', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('template', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_TEMPLATE_HAS_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_TEMPLATE_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // set warning message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_TEMPLATE_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=template'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the specified Template.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the item data posted by the user.
+ * 3. It checks whether the current user has the necessary permissions to push the Template.
+ * 4. It validates the presence of the necessary item identifiers (ID and GUID).
+ * 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Template.
+ * 6. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 7. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get Item posted
+ $item = $this->input->post->get('jform', array(), 'array');
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_TEMPLATE') . '
';
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Template.Remote.Set')->getGuidField();
+
+ // load the ID
+ $id = $item['id'] ?? null;
+ $guid = $item[$key_field] ?? null;
+
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if there is any selections
+ if ($id === null || $guid === null)
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NOT_PUSHED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_TEMPLATE_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '
';
+ }
+ elseif($user->authorise('template.push', 'com_componentbuilder'))
+ {
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('template', [$guid]);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_TEMPLATE_HAS_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_TEMPLATE_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_TEMPLATE_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+ }
+
+ // set redirect
+ $redirect_url = Route::_(
+ 'index.php?option=com_componentbuilder&view=template'
+ . $this->getRedirectToItemAppend($id), false
+ );
+
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
/**
* Method override to check if you can add a new record.
*
@@ -217,7 +441,7 @@ class TemplateController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Template', '', []);
@@ -281,6 +505,15 @@ class TemplateController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +596,15 @@ class TemplateController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('template.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Controller/TemplatesController.php b/admin/src/Controller/TemplatesController.php
index 53f0f4f41..1a3b22dbd 100644
--- a/admin/src/Controller/TemplatesController.php
+++ b/admin/src/Controller/TemplatesController.php
@@ -17,6 +17,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -52,12 +53,272 @@ class TemplatesController extends AdminController
return parent::getModel($name, $prefix, $config);
}
- public function getSnippets()
+
+ /**
+ * Redirect the request to the Initialization selection page.
+ *
+ * @return bool True on successful initialization, false on failure.
+ * @since 5.1.1
+ */
+ public function initPowers()
{
// Check for request forgeries
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
- // redirect to the import snippets custom admin view
- $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false));
- return;
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+
+ // set default error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_TEMPLATES') . '
';
+ $status = 'error';
+ $success = false;
+
+ if($user->authorise('template.init', 'com_componentbuilder'))
+ {
+ // set success message
+ $message = null;
+
+ $status = null;
+ $success = true;
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=initialization_selection&power=Template&target=Templates', false);
+ }
+ else
+ {
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=templates', false);
+ }
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ /**
+ * Resets the selected Templates.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to reset the selected Templates.
+ * 6. If the user is authorized and powers are selected, it attempts to reset the selected Templates.
+ * 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful reset, false on failure.
+ * @since 5.1.1
+ */
+ public function resetPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=templates', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('template.reset', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Template.Remote.Get')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['template'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Get')->reset('template', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_TEMPLATES_HAVE_SUCCESSFULLY_BEEN_RESET') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_TEMPLATES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_TEMPLATES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=templates', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=templates', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
+ }
+
+ /**
+ * Pushes the selected Templates.
+ *
+ * This function performs several checks and operations:
+ * 1. It verifies the authenticity of the request to prevent request forgery.
+ * 2. It retrieves the IDs of the selected powers from the user input.
+ * 3. It sanitizes the input by converting the IDs to integers.
+ * 4. It checks whether any powers have been selected.
+ * 5. It checks whether the current user has the necessary permissions to push the selected Templates.
+ * 6. If the user is authorized and powers are selected, it attempts to push the selected Templates.
+ * 7. Depending on the result of the push operation, it sets the appropriate success or error message.
+ * 8. It redirects the user to a specified URL with the result message and status.
+ *
+ * @return bool True on successful push, false on failure.
+ * @since 5.1.1
+ */
+ public function pushPowers()
+ {
+ // Check for request forgeries
+ Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
+
+ // get IDS of the selected powers
+ $pks = $this->input->post->get('cid', [], 'array');
+
+ // Sanitize the input
+ ArrayHelper::toInteger($pks);
+
+ // check if there is any selections
+ if ($pks === [])
+ {
+ // set error message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST') . '
';
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=templates', false);
+ $this->setRedirect($redirect_url, $message, 'error');
+ return false;
+ }
+
+ $status = 'error';
+ $success = false;
+ $has_error = false;
+ $message_bus = ['success', 'warning', 'error'];
+
+ // check if user has the right
+ $user = $this->app->getIdentity();
+ if($user->authorise('template.push', 'com_componentbuilder'))
+ {
+ // get the guid field of this entity
+ $key_field = PackageFactory::_('Template.Remote.Set')->getGuidField();
+ $guids = PackageFactory::_('Load')->values([$key_field], ['template'], ['id' => ['value' => $pks, 'operator' => 'IN']]);
+
+ try {
+ PackageFactory::_('Package.Builder.Set')->items('template', $guids);
+
+ foreach ($message_bus as $message_key)
+ {
+ if (($messages = PackageFactory::_('Power.Message')->get($message_key, null)) !== null)
+ {
+ $messages = '' . implode(' ', $messages) . '
';
+ $this->app->enqueueMessage($messages, $message_key);
+
+ if (!$success && $message_key === 'success')
+ {
+ $success = true;
+ }
+
+ if (!$has_error && $message_key === 'error')
+ {
+ $has_error = true;
+ }
+ }
+ }
+
+ if ($success)
+ {
+ // set success message
+ $message = '' . Text::_('COM_COMPONENTBUILDER_SUCCESS') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THESE_TEMPLATES_HAVE_SUCCESSFULLY_BEEN_PUSHED') . '
';
+ $status = 'success';
+ }
+ elseif ($has_error)
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_TEMPLATES_HAS_FAILED') . '
';
+ $status = 'error';
+ }
+ else
+ {
+ // Initialize base values
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_UNSUCCESSFUL') . ' ';
+ $message .= '' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_TEMPLATES_HAS_NOT_BEEN_SUCCESSFUL') . '
';
+ $status = 'warning';
+ }
+ } catch (\Exception $e) {
+ $message = '' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . ' ';
+ $message .= '' . \htmlspecialchars($e->getMessage()) . '
';
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=templates', false);
+ $this->setRedirect($redirect_url, $message, $status);
+
+ return $success;
+ }
+
+ // set redirect
+ $redirect_url = Route::_('index.php?option=com_componentbuilder&view=templates', false);
+ $this->setRedirect($redirect_url);
+
+ return $success;
}
}
\ No newline at end of file
diff --git a/admin/src/Controller/Validation_ruleController.php b/admin/src/Controller/Validation_ruleController.php
index 05488d584..a5f58b7ee 100644
--- a/admin/src/Controller/Validation_ruleController.php
+++ b/admin/src/Controller/Validation_ruleController.php
@@ -217,7 +217,7 @@ class Validation_ruleController extends FormController
*/
public function batch($model = null)
{
- Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+ Session::checkToken() or exit(Text::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Validation_rule', '', []);
@@ -281,6 +281,15 @@ class Validation_ruleController extends FormController
)
);
}
+ // When editing in modal then redirect to modalreturn layout
+ elseif ($cancel && $this->input->get('layout') === 'modal')
+ {
+ $id = $this->input->get('id');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=cancel';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return $cancel;
}
@@ -363,6 +372,15 @@ class Validation_ruleController extends FormController
*/
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{
+ if ($this->input->get('layout') === 'modal' && $this->task === 'save')
+ {
+ // When editing in modal then redirect to modalreturn layout
+ $id = $model->getState('validation_rule.id', '');
+ $return = 'index.php?option=' . $this->option . '&view=' . $this->view_item . $this->getRedirectToItemAppend($id)
+ . '&layout=modalreturn&from-task=save';
+
+ $this->setRedirect(Route::_($return, false));
+ }
return;
}
}
diff --git a/admin/src/Field/AdminviewfolderlistField.php b/admin/src/Field/AdminviewfolderlistField.php
index cca62b117..7b86fdc2a 100644
--- a/admin/src/Field/AdminviewfolderlistField.php
+++ b/admin/src/Field/AdminviewfolderlistField.php
@@ -17,7 +17,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
-use Joomla\CMS\Filesystem\Folder;
+use Joomla\Filesystem\Folder;
// No direct access to this file
\defined('_JEXEC') or die;
diff --git a/admin/src/Field/CustomfilelistField.php b/admin/src/Field/CustomfilelistField.php
index 590220f24..bd74b9961 100644
--- a/admin/src/Field/CustomfilelistField.php
+++ b/admin/src/Field/CustomfilelistField.php
@@ -16,7 +16,7 @@ use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use Joomla\CMS\Filesystem\Folder;
+use Joomla\Filesystem\Folder;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -44,7 +44,7 @@ class CustomfilelistField extends ListField
protected function getOptions()
{
// get custom folder files
- $localfolder = ComponentHelper::getParams('com_componentbuilder')->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/custom');
+ $localfolder = ComponentHelper::getParams('com_componentbuilder')->get('custom_folder_path', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/custom');
// set the default
$options[] = Html::_('select.option', '', Text::sprintf('COM_COMPONENTBUILDER_PLEASE_ADD_FILES_TO_S',$localfolder));
// setup the folder if it does not exist
diff --git a/admin/src/Field/CustomfolderlistField.php b/admin/src/Field/CustomfolderlistField.php
index 83465838f..65030fcc2 100644
--- a/admin/src/Field/CustomfolderlistField.php
+++ b/admin/src/Field/CustomfolderlistField.php
@@ -16,7 +16,7 @@ use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use Joomla\CMS\Filesystem\Folder;
+use Joomla\Filesystem\Folder;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -44,11 +44,11 @@ class CustomfolderlistField extends ListField
protected function getOptions()
{
// get custom folder folder
- $localfolder = ComponentHelper::getParams('com_componentbuilder')->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR.'/custom');
+ $localfolder = ComponentHelper::getParams('com_componentbuilder')->get('custom_folder_path', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/custom');
// set the default
$options[] = Html::_('select.option', '', Text::sprintf('COM_COMPONENTBUILDER_PLEASE_ADD_FOLDERS_TO_S',$localfolder));
// setup the folder if it does not exist
- if (!Folder::exists($localfolder))
+ if (!is_dir($localfolder))
{
Folder::create($localfolder);
}
diff --git a/admin/src/Field/DynamicdashboardField.php b/admin/src/Field/DynamicdashboardField.php
index 9642da4db..c1f0faea0 100644
--- a/admin/src/Field/DynamicdashboardField.php
+++ b/admin/src/Field/DynamicdashboardField.php
@@ -20,6 +20,7 @@ use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
+use VDM\Joomla\Utilities\GuidHelper;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -51,20 +52,21 @@ class DynamicdashboardField extends ListField
// get the input from url
$jinput = Factory::getApplication()->input;
// get the id
- $ID = $jinput->getInt('id', 0);
+ $id = $jinput->getInt('id', 0);
// set the targets
$targets = ['adminview' => 'admin_view', 'customadminview' => 'custom_admin_view'];
$t = ['adminview' => 'A', 'customadminview' => 'C'];
// rest the options
$options = [];
- // reset the custom admin views array
- $views = false;
- if (is_numeric($ID) && $ID >= 1)
+ // reset the custom admin & admin views array
+ $views = [];
+ if (is_numeric($id) && $id >= 1)
{
+ $guid = GetHelper::var('joomla_component', (int) $id, 'id', 'guid');
// get the linked back-end views
foreach ($targets as $target => $view)
{
- if ($result = GetHelper::var('component_'.$view.'s', (int) $ID, 'joomla_component', 'add'.$view.'s'))
+ if ($result = GetHelper::var('component_' . $view . 's', $guid, 'joomla_component', 'add' . $view . 's'))
{
$views[$target] = $result;
}
@@ -75,6 +77,7 @@ class DynamicdashboardField extends ListField
// not linked so there is none available
return [Html::_('select.option', '', Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_LINK_AN_ADMIN_OR_A_CUSTOM_ADMIN_VIEW_TO_THIS_COMPONENT_THEN_YOU_CAN_SELECT_IT_HERE'))];
}
+
// check if we found any values
if (ArrayHelper::check($views))
{
@@ -89,12 +92,28 @@ class DynamicdashboardField extends ListField
{
foreach ($value as $_view)
{
- if (isset($_view[$target]) && is_numeric($_view[$target]))
+ if (!isset($_view[$target]))
+ {
+ continue;
+ }
+
+ $key_id = null;
+ $key_value = $_view[$target];
+ if (is_numeric($key_value))
+ {
+ $key_id = 'id';
+ }
+ elseif (GuidHelper::valid($key_value))
+ {
+ $key_id = 'guid';
+ }
+
+ if ($key_id !== null)
{
// set the view to the selections if found
- if ($name = GetHelper::var($view, (int) $_view[$target], 'id', 'system_name'))
+ if (($name = GetHelper::var($view, $key_value, $key_id, 'system_name')) !== null)
{
- $options[] = Html::_('select.option', $t[$target].'_'.$_view[$target], $name.' ['.$type.']');
+ $options[] = Html::_('select.option', $t[$target] . '_' . $key_value, $name . ' [' . $type . ']');
}
}
}
@@ -102,12 +121,14 @@ class DynamicdashboardField extends ListField
}
}
}
+
// return found options
if (ArrayHelper::check($options))
{
array_unshift($options , Html::_('select.option', '', Text::_('COM_COMPONENTBUILDER_SELECT_AN_OPTION')));
return $options;
}
+
// not linked so there is none available
return [Html::_('select.option', '', Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_LINK_AN_ADMIN_OR_A_CUSTOM_ADMIN_VIEW_TO_THIS_COMPONENT_THEN_YOU_CAN_SELECT_IT_HERE'))];
}
diff --git a/admin/src/Field/SiteviewfolderlistField.php b/admin/src/Field/SiteviewfolderlistField.php
index 3d2e81a7e..cc48e9a92 100644
--- a/admin/src/Field/SiteviewfolderlistField.php
+++ b/admin/src/Field/SiteviewfolderlistField.php
@@ -17,7 +17,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Component\ComponentHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
-use Joomla\CMS\Filesystem\Folder;
+use Joomla\Filesystem\Folder;
// No direct access to this file
\defined('_JEXEC') or die;
diff --git a/admin/src/Helper/ComponentbuilderEmail.php b/admin/src/Helper/ComponentbuilderEmail.php
index f1e8a0399..8fd72a136 100644
--- a/admin/src/Helper/ComponentbuilderEmail.php
+++ b/admin/src/Helper/ComponentbuilderEmail.php
@@ -34,7 +34,7 @@ abstract class ComponentbuilderEmail
public static $active = [];
/**
- * Configuraiton object
+ * Configuration object
*
* @var Registry
*/
diff --git a/admin/src/Helper/ComponentbuilderHelper.php b/admin/src/Helper/ComponentbuilderHelper.php
index 98d39e3ee..1c826557c 100644
--- a/admin/src/Helper/ComponentbuilderHelper.php
+++ b/admin/src/Helper/ComponentbuilderHelper.php
@@ -42,8 +42,8 @@ use VDM\Joomla\Utilities\GuidHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
-use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\FileHelper;
+use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\Component\Helper;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\FieldHelper;
@@ -58,6 +58,7 @@ use VDM\Joomla\Utilities\String\NamespaceHelper;
use VDM\Joomla\Utilities\MathHelper;
use VDM\Joomla\Utilities\String\PluginHelper;
use VDM\Joomla\Utilities\FormHelper;
+use Joomla\Filesystem\Folder as FilesystemFolder;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Router\Route;
@@ -183,11 +184,11 @@ abstract class ComponentbuilderHelper
// The path to the cache folder.
'JPATH_CACHE' => JPATH_CACHE,
// The path to the administration folder of the current component being executed.
- 'JPATH_COMPONENT_ADMINISTRATOR' => JPATH_COMPONENT_ADMINISTRATOR,
+ 'JPATH_COMPONENT_ADMINISTRATOR' => JPATH_ADMINISTRATOR . '/components/com_componentbuilder',
// The path to the site folder of the current component being executed.
- 'JPATH_COMPONENT_SITE' => JPATH_COMPONENT_SITE,
+ 'JPATH_COMPONENT_SITE' => JPATH_SITE . '/components/com_componentbuilder',
// The path to the current component being executed.
- 'JPATH_COMPONENT' => JPATH_COMPONENT,
+ 'JPATH_COMPONENT' => JPATH_BASE . '/components/com_componentbuilder',
// The path to folder containing the configuration.php file.
'JPATH_CONFIGURATION' => JPATH_CONFIGURATION,
// The path to the installation folder.
@@ -728,59 +729,72 @@ abstract class ComponentbuilderHelper
}
}
- /*
- * Get the Array of Existing Validation Rule Names
+ /**
+ * Get the array of existing Joomla validation rule class names
*
- * @return array|null
+ * @param bool $lowercase If true, converts names to lowercase
+ *
+ * @return array|null Array of rule names or null on failure
* @since 3.0.0
*/
public static function getExistingValidationRuleNames(bool $lowercase = false): ?array
{
- // get the items
- $items = self::get('_existing_validation_rules_VDM', null);
- if (!$items)
+ // Try to retrieve from static cache
+ $cacheKey = '_existing_validation_rules_VDM';
+ $cached = self::get($cacheKey, null);
+
+ if (!empty($cached) && is_string($cached))
+ {
+ $items = json_decode($cached, true);
+ }
+ else
{
- // set the path to the form validation rules
$path = JPATH_LIBRARIES . '/src/Form/Rule';
- // check if the path exist
- if (!Folder::exists($path))
+
+ if (!is_dir($path))
{
return null;
}
- // we must first store the current working directory
- $joomla = getcwd();
- // go to that folder
- chdir($path);
- // load all the files in this path
- $items = Folder::files('.', '\.php', true, true);
- // change back to Joomla working directory
- chdir($joomla);
- // make sure we have an array
- if (!UtilitiesArrayHelper::check($items))
+
+ $original_dir = getcwd();
+ if (!@chdir($path))
{
return null;
}
- // remove the Rule.php from the name
- $items = array_map( function ($name) {
- return str_replace(array('./','Rule.php'), '', $name);
- }, $items);
- // store the names for next run
- self::set('_existing_validation_rules_VDM', json_encode($items));
- }
- // make sure it is no longer json
- if (JsonHelper::check($items))
- {
- $items = json_decode($items, true);
- }
- // check if the names should be all lowercase
- if ($lowercase)
- {
- $items = array_map( function($item) {
- return strtolower($item);
- }, $items);
+
+ try {
+ $files = FilesystemFolder::files(
+ '.',
+ '\.php',
+ true,
+ true
+ );
+ } catch (\Throwable $e) {
+ return null;
+ } finally {
+ @chdir($original_dir);
+ }
+
+ if (!UtilitiesArrayHelper::check($files)) {
+ return null;
+ }
+
+ $items = array_map(
+ fn(string $file) => str_replace(['./', 'Rule.php'], '', $file),
+ $files
+ );
+
+ // Cache it for next time
+ self::set($cacheKey, json_encode($items));
}
- return $items;
+ // Normalize casing if requested
+ if ($lowercase && is_array($items))
+ {
+ $items = array_map('strtolower', $items);
+ }
+
+ return is_array($items) ? $items : null;
}
/**
@@ -1000,7 +1014,7 @@ abstract class ComponentbuilderHelper
$bucket = [];
// get custom folder path
- $customPath = '/'.trim(self::$params->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR.'/custom'), '/');
+ $customPath = '/'.trim(self::$params->get('custom_folder_path', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/custom'), '/');
// get all the file paths
foreach ($result->addfolders as $folder)
@@ -1474,7 +1488,7 @@ abstract class ComponentbuilderHelper
if (UtilitiesStringHelper::check($hash))
{
// first get the file path
- $path_filename = FileHelper::getPath('path', $name.$type, $fileType, $key, JPATH_COMPONENT_ADMINISTRATOR);
+ $path_filename = FileHelper::getPath('path', $name.$type, $fileType, $key, JPATH_ADMINISTRATOR . '/components/com_componentbuilder');
// set as read if not already set
if ($content = FileHelper::getContent($path_filename, false))
{
@@ -2222,7 +2236,7 @@ abstract class ComponentbuilderHelper
md5($image_data) === $target['hash'])
{
// create the JCB type path if it does not exist
- if (!Folder::exists(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type"))
+ if (!is_dir(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type"))
{
Folder::create(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type");
}
@@ -2649,7 +2663,7 @@ abstract class ComponentbuilderHelper
*/
public static function removeFolder(string $path, ?array $ignore = null): bool
{
- if (!Folder::exists($path))
+ if (!is_dir($path))
{
return false;
}
@@ -3407,7 +3421,7 @@ abstract class ComponentbuilderHelper
$script['view'][] = self::_t(1) . "var outerDiv = \$('body');";
$script['view'][] = "";
$script['view'][] = PHP_EOL . self::_t(1) . "\$('
')";
- $script['view'][] = self::_t(2) . ".css(\"background\", \"rgba(255, 255, 255, .8) url('components/com_[[[-#-#-component]]]/assets/images/import.gif') 50% 15% no-repeat\")";
+ $script['view'][] = self::_t(2) . ".css(\"background\", \"rgba(255, 255, 255, .8) url('components/com_[[[-#-#-component]]]/assets/images/ajax.gif') 50% 35% no-repeat\")";
$script['view'][] = self::_t(2) . ".css(\"top\", outerDiv.position().top - \$(window).scrollTop())";
$script['view'][] = self::_t(2) . ".css(\"left\", outerDiv.position().left - \$(window).scrollLeft())";
$script['view'][] = self::_t(2) . ".css(\"width\", outerDiv.width())";
@@ -3851,7 +3865,7 @@ abstract class ComponentbuilderHelper
}
$folderPath = self::$params->get($target, $default);
// create the folder if it does not exist
- if ($createIfNotSet && !Folder::exists($folderPath))
+ if ($createIfNotSet && !is_dir($folderPath))
{
Folder::create($folderPath);
}
diff --git a/admin/src/Helper/PowerloaderHelper.php b/admin/src/Helper/PowerloaderHelper.php
index d9adcc38a..957cdbf77 100644
--- a/admin/src/Helper/PowerloaderHelper.php
+++ b/admin/src/Helper/PowerloaderHelper.php
@@ -23,8 +23,10 @@ if (file_exists($composer_autoloader))
spl_autoload_register(function ($class) {
// project-specific base directories and namespace prefix
$search = [
+ 'libraries/vendor_jcb/VDM.Joomla.Github' => 'VDM\\Joomla\\Github',
'libraries/vendor_jcb/VDM.Joomla.Gitea' => 'VDM\\Joomla\\Gitea',
'libraries/vendor_jcb/VDM.Joomla.FOF' => 'VDM\\Joomla\\FOF',
+ 'libraries/vendor_jcb/VDM.Joomla.Git' => 'VDM\\Joomla\\Git',
'libraries/vendor_jcb/VDM.Joomla' => 'VDM\\Joomla',
'libraries/vendor_jcb/VDM.Minify' => 'VDM\\Minify',
'libraries/vendor_jcb/VDM.Psr' => 'VDM\\Psr'
diff --git a/admin/src/Model/AjaxModel.php b/admin/src/Model/AjaxModel.php
index ec5e5a140..c5d494c82 100644
--- a/admin/src/Model/AjaxModel.php
+++ b/admin/src/Model/AjaxModel.php
@@ -28,12 +28,13 @@ use Joomla\CMS\Uri\Uri;
use Joomla\Registry\Registry;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Gitea\Factory as GiteaFactory;
-use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
use VDM\Joomla\Utilities\GuidHelper;
+use VDM\Joomla\Componentbuilder\Remote\Version;
+use VDM\Joomla\Github\Factory as GithubFactory;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\SessionHelper;
@@ -41,6 +42,12 @@ use VDM\Joomla\Utilities\Base64Helper;
use VDM\Joomla\Componentbuilder\Table\Search;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\FieldHelper;
use VDM\Joomla\Utilities\FormHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
+use VDM\Joomla\Componentbuilder\Fieldtype\Factory as FieldtypeFactory;
+use VDM\Joomla\Componentbuilder\JoomlaPower\Factory as JoomlaPowerFactory;
+use VDM\Joomla\Componentbuilder\Power\Factory as PowerFactory;
+use VDM\Joomla\Componentbuilder\Snippet\Factory as SnippetFactory;
+use VDM\Joomla\Componentbuilder\Repository\Factory as RepositoryFactory;
use Joomla\CMS\Form\FormHelper as FormFormHelper;
// No direct access to this file
@@ -87,95 +94,6 @@ class AjaxModel extends ListModel
}
// Used in joomla_component
- /**
- * Will be removed since we are going the AI route... instead.
- */
- public function getCrowdinDetails($identifier, $key)
- {
- // set the url
- $url = "https://api.crowdin.com/api/project/$identifier/info?key=$key&json";
- // get the details
- if (($details = FileHelper::getContent($url, false)) !== false && JsonHelper::check($details))
- {
- $details = json_decode($details, true);
- // check if there is an error
- if (isset($details['error']))
- {
- return ['error' => '' . $details['error']['message'] . 'Identifier: ' . $identifier . '
'];
- }
- // build the details html
- if (isset($details['details']))
- {
- $html = '';
- $html .= '
' . Text::_('COM_COMPONENTBUILDER_COMPONENT_SUCCESSFULLY_LINKED') . ' ';
- $html .= '
' . $details['details']['name'] . ' ';
- if (StringHelper::check($details['details']['description']))
- {
- $html .= '
';
- $html .= $details['details']['description'];
- $html .= '
';
- }
- $html .= '
';
- $html .= 'Number of participants: ';
- $html .= $details['details']['participants_count'];
- $html .= ' ';
- $html .= 'Total strings count: ';
- $html .= $details['details']['total_strings_count'];
- $html .= ' ';
- $html .= 'Total words count: ';
- $html .= $details['details']['total_words_count'];
- $html .= ' ';
- $html .= 'Created: ';
- $html .= ComponentbuilderHelper::fancyDate($details['details']['created']);
- $html .= ' ';
- $html .= 'Last activity: ';
- $html .= ComponentbuilderHelper::fancyDate($details['details']['last_activity']);
- $html .= ' ';
- $html .= ' ';
- $html .= '
';
- return ['html' => $html];
- }
- }
- return false;
- }
-
- /**
- * Will be removed since we are moving to the new SuperPowers distribution system.
- */
- public function getJCBpackageInfo($package)
- {
- // convert URL
- $url = base64_decode($package);
- $url = str_replace('.zip', '.info', $url);
-
- // check if url exist
- if ($info = FileHelper::getContent($url, false))
- {
- $_info = PackageFactory::_('Crypt')->decrypt($info, 'local.legacy');
-
- // check if we had success
- if (!JsonHelper::check($_info))
- {
- $_info = PackageFactory::_('Crypt')->decrypt($info, 'local.fof');
- }
-
- // check if we have json
- if (JsonHelper::check($_info))
- {
- $info = json_decode($_info, true);
-
- return [
- 'owner' => PackageFactory::_('Display.Details')->owner($info, true),
- 'packages' => PackageFactory::_('Display.Details')->components($info)
- ];
- }
- }
-
- return [
- 'error' => Text::_('COM_COMPONENTBUILDER_JCB_PACKAGE_INFO_PATH_DOES_NOT_WORK_WE_ADVICE_YOU_BNOT_TO_CONTINUEB_WITH_THE_IMPORT_OF_THE_SELECTED_PACKAGE')
- ];
- }
-
/**
* Retrieves the component details as an HTML display and metadata.
*
@@ -361,172 +279,46 @@ class AjaxModel extends ListModel
return implode("\n", $html);
}
-
- /**
- * Will be removed, since we will change to workflows soon :)
- */
- public function getCronPath($type)
- {
- return ['error' => '' . Text::_('COM_COMPONENTBUILDER_NO_CRONJOB_PATHS_WAS_REMOVED_WE_WILL_CHANGE_TO_WORKFLOWS_SOON') . ' '];
- }
/**
- * get Current Version
+ * Get the current version notice.
*
- * @param string|null $message The error messages if any.
+ * Compares the installed version of the component with the latest available
+ * version from the repository tags and returns an appropriate message.
*
- * @return array The array of the notice or error message
+ * @param string|null $version Optional version to compare if manifest version not found.
+ *
+ * @return array The array with 'notice' or 'error' and optional 'github-error' / 'gitea-error'.
* @since 2.3.0
+ * @since 5.1.1 Improved with support for pre-releases and intelligent tag grouping.
*/
- public function getVersion($version = null)
+ public function getVersion(?string $version = null): array
{
- try
- {
- // get the repository tags
- $tags = GiteaFactory::_('Gitea.Repository.Tags')->list('joomla', 'Component-Builder');
- }
- catch (DomainException $e)
- {
- return $this->getTokenForVersion($e->getMessage());
- }
- catch (InvalidArgumentException $e)
- {
- return $this->getTokenForVersion($e->getMessage());
- }
- catch (Exception $e)
- {
- return $this->getTokenForVersion($e->getMessage());
- }
- // do we have tags returned
- if (isset($tags[0]) && isset($tags[0]->name))
- {
- // get the local version
- $manifest = ComponentbuilderHelper::manifest();
- $local_version = (string) $manifest->version;
- $latest_version = '1.0.0';
- $download_link = "https://git.vdm.dev/api/v1/joomla/Component-Builder";
-
- // Filter tags by major version matching the local version's major number
- $major_version = explode('.', $local_version)[0];
- $filtered_tags = array_filter($tags, function($tag) use ($major_version) {
- return strpos($tag->name, "v$major_version") === 0;
- });
-
- if (!empty($filtered_tags))
- {
- // Sort versions to find the latest one
- usort($filtered_tags, function($a, $b) {
- return \version_compare($b->name, $a->name);
- });
-
- $latest_version = trim($filtered_tags[0]->name, 'vV');
-
- // download link of the latest version
- $download_link = $filtered_tags[0]->zipball_url;
- }
-
- // now check if this version is out dated
- if (\version_compare($local_version, $latest_version) === 0)
- {
- return ['notice' => ' ' . Text::_('COM_COMPONENTBUILDER_UP_TO_DATE') . ' '];
- }
- else
- {
- // check if this is beta version
- if (\version_compare($local_version, $latest_version) > 0)
- {
- return ['notice' => ' ' . Text::_('COM_COMPONENTBUILDER_PRE_RELEASE') . ' '];
- }
- else
- {
- return ['notice' => ' ' . Text::_('COM_COMPONENTBUILDER_OUT_OF_DATE') . '! ' . Text::_('COM_COMPONENTBUILDER_DOWNLOAD_UPDATE') . '! '];
- }
- }
- }
-
- return $this->getTokenForVersion();
+ return (new Version(
+ 'joomengine', 'pkg-component-builder',
+ 'joomla', 'pkg-component-builder'
+ ))->get($version);
}
/**
- * Instructions to get Token for version
+ * Get the content of a GitHub wiki page.
*
- * @param string|null $message The error messages if any.
+ * @param string $name The name of the wiki page (default: 'Home').
*
- * @return array The array of the error message
- * @since 2.3.0
- */
- protected function getTokenForVersion(?string $message = null): array
- {
- // the URL
- $url = 'https://git.vdm.dev/user/settings/applications';
-
- // create link
- $a = '';
- $_a = ' ';
-
- if ($message)
- {
- return ['error' => $a . $message . $a_ . Text::_('COM_COMPONENTBUILDER_GET_TOKEN') . $_a];
- }
-
- return ['error' => $a . Text::_('COM_COMPONENTBUILDER_GET_TOKEN_FROM_VDM_TO_GET_UPDATE_NOTICE_AND_ADD_IT_TO_YOUR_GLOBAL_OPTIONS') . $a_ . Text::_('COM_COMPONENTBUILDER_GET_TOKEN') . $_a];
- }
-
- /**
- * get Wiki Page
- *
- * @param string|null $message The error messages if any.
- *
- * @return array The array of the page or error message
+ * @return array Associative array with 'page' or 'error' key.
* @since 2.3.0
*/
public function getWiki(string $name = 'Home'): array
{
- try
- {
- // get the gitea wiki page im markdown
- $wiki = GiteaFactory::_('Gitea.Repository.Wiki')->get('joomla', 'Component-Builder', $name);
+ try {
+ $wiki = GithubFactory::_('Github.Repository.Wiki')
+ ->get('joomengine', 'Joomla-Component-Builder', $name);
- // now render the page in HTML
- $page = $wiki->content ?? null;
- }
- catch (\DomainException $e)
- {
- return $this->getTokenForWiki($e->getMessage());
- }
- catch (\InvalidArgumentException $e)
- {
- return $this->getTokenForWiki($e->getMessage());
- }
- catch (\Exception $e)
- {
- return $this->getTokenForWiki($e->getMessage());
- }
-
- // get the html
- if (isset($page))
- {
- return ['page' => $page];
- }
-
- return $this->getTokenForWiki();
- }
-
- /**
- * Instructions to get Token for wiki
- *
- * @param string|null $message The error messages if any.
- *
- * @return array The array of the error message
- * @since 2.3.0
- */
- protected function getTokenForWiki(?string $message = null): array
- {
- if ($message)
- {
- return ['error' => $message];
+ if (!empty($wiki->content)) {
+ return ['page' => base64_decode($wiki->content)];
+ }
+ } catch (\Throwable $e) {
+ return ['error' => $e->getMessage()];
}
return ['error' => Text::_('COM_COMPONENTBUILDER_THE_WIKI_CAN_ONLY_BE_LOADED_WHEN_YOUR_JCB_SYSTEM_HAS_INTERNET_CONNECTION')];
@@ -4320,132 +4112,6 @@ class AjaxModel extends ListModel
}
// Used in snippet
-
- public function getSnippets($libraries)
- {
- if (JsonHelper::check($libraries))
- {
- $libraries = json_decode($libraries, true);
- }
- // check if we have an array
- if (UtilitiesArrayHelper::check($libraries))
- {
- // insure we only have int values
- if ($libraries = $this->checkLibraries($libraries))
- {
- // Get a db connection.
- $db = Factory::getDbo();
- // Create a new query object.
- $query = $db->getQuery(true);
- $query->select($db->quoteName( array('a.id') ));
- $query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
- $query->where($db->quoteName('a.published') . ' = 1');
- // check for country and region
- $query->where($db->quoteName('a.library') . ' IN ('. implode(',',$libraries) .')');
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- return $db->loadColumn();
- }
- }
- }
- return false;
- }
-
- protected function checkLibraries($libraries)
- {
- $bucket = array();
- $libraries = array_map( function($id) use (&$bucket) {
- // now get bundled libraries
- $type = GetHelper::var('library', (int) $id, 'id', 'type');
- if (2 == $type && $bundled = GetHelper::var('library', (int) $id, 'id', 'libraries'))
- {
- // make sure we have an array if it was json
- if (JsonHelper::check($bundled))
- {
- $bundled = json_decode($bundled, true);
- }
- // load in the values if we have an array
- if (UtilitiesArrayHelper::check($bundled))
- {
- foreach ($bundled as $lib)
- {
- $bucket[$lib] = $lib;
- }
- }
- elseif (is_numeric($bundled))
- {
- $bucket[(int) $bundled] = (int) $bundled;
- }
- }
- else
- {
- return (int) $id;
- }
- }, $libraries);
- // check if we have any bundled libraries
- if (UtilitiesArrayHelper::check($bucket))
- {
- foreach ($bucket as $lib)
- {
- $libraries[] = (int) $lib;
- }
- }
- // check that we have libraries
- if (UtilitiesArrayHelper::check($libraries))
- {
- $libraries = array_values(array_unique(array_filter($libraries, function($id){return is_int($id);})));
- // check if we have any libraries remaining
- if (UtilitiesArrayHelper::check($libraries))
- {
- return $libraries;
- }
- }
- return false;
- }
- public function getSnippetDetails($key)
- {
- if (GuidHelper::valid($key))
- {
- $target = 'guid';
- }
- elseif (is_numeric($key))
- {
- $target = 'id';
- }
- else
- {
- return false;
- }
-
- // Get a db connection.
- $db = Factory::getDbo();
-
- // Create a new query object.
- $query = $db->getQuery(true);
- $query->select($db->quoteName(array('a.name', 'a.heading', 'a.usage', 'a.description', 'b.name', 'a.snippet', 'a.url', 'c.name'), array('name', 'heading', 'usage', 'description', 'type', 'snippet', 'url', 'library')));
- $query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
- // From the componentbuilder_snippet_type table.
- $query->join('LEFT', $db->quoteName('#__componentbuilder_snippet_type', 'b') . ' ON (' . $db->quoteName('a.type') . ' = ' . $db->quoteName('b.id') . ')');
- // From the componentbuilder_library table.
- $query->join('LEFT', $db->quoteName('#__componentbuilder_library', 'c') . ' ON (' . $db->quoteName('a.library') . ' = ' . $db->quoteName('c.id') . ')');
- $query->where($db->quoteName('a.published') . ' >= 1');
- $query->where($db->quoteName('a.' . $target) . ' = ' . $db->quote($key));
-
- // Reset the query using our newly populated query object.
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- $snippet = $db->loadObject();
- $snippet->snippet = base64_decode($snippet->snippet);
- // return found snippet settings
- return $snippet;
- }
- return false;
- }
-
public function setSnippetGithub($path, $status)
{
// get user
@@ -4503,7 +4169,7 @@ class AjaxModel extends ListModel
}
}
// get the snippet model
- $model = ComponentbuilderHelper::getModel('snippet', JPATH_COMPONENT_ADMINISTRATOR);
+ $model = ComponentbuilderHelper::getModel('snippet', JPATH_ADMINISTRATOR . '/components/com_componentbuilder');
// save the snippet
if ($model->save($item))
{
@@ -4569,7 +4235,7 @@ class AjaxModel extends ListModel
if (ComponentbuilderHelper::getActions($type)->get('core.create'))
{
// get the snippet model
- $model = ComponentbuilderHelper::getModel($type, JPATH_COMPONENT_ADMINISTRATOR);
+ $model = ComponentbuilderHelper::getModel($type, JPATH_ADMINISTRATOR . '/components/com_componentbuilder');
// build array to save
$item['id'] = 0;
$item['name'] = $name;
@@ -4584,6 +4250,191 @@ class AjaxModel extends ListModel
return $item->get('id');
}
return 0;
+ }
+
+ /**
+ * Retrieves published snippet GUIDs for valid libraries.
+ *
+ * @param mixed $libraries JSON string or array of library GUIDs.
+ *
+ * @return array|false List of snippet IDs or false on failure.
+ * @since 5.1.1
+ */
+ public function getSnippets($libraries)
+ {
+ // Decode JSON if required
+ if (JsonHelper::check($libraries))
+ {
+ $libraries = json_decode($libraries, true);
+ }
+
+ // Ensure we have a valid array of libraries
+ if (!UtilitiesArrayHelper::check($libraries))
+ {
+ return false;
+ }
+
+ // Validate and expand libraries
+ $validatedLibraries = $this->expandAndValidateLibraries($libraries);
+
+ if (!$validatedLibraries)
+ {
+ return false;
+ }
+
+ $db = Factory::getDbo();
+ $query = $db->getQuery(true)
+ ->select($db->quoteName('a.id'))
+ ->from($db->quoteName('#__componentbuilder_snippet', 'a'))
+ ->where($db->quoteName('a.published') . ' = 1')
+ ->where($db->quoteName('a.library') . ' IN ("' . implode('","', $validatedLibraries) . '")');
+
+ $db->setQuery($query);
+ $db->execute();
+
+ return $db->getNumRows() ? $db->loadColumn() : false;
+ }
+
+ /**
+ * Validates and expands library GUIDs to ensure only integers and valid references remain.
+ *
+ * @param array $libraries The original list of library GUIDs.
+ *
+ * @return array|false Sanitized and validated list of libraries, or false.
+ * @since 5.1.1
+ */
+ protected function expandAndValidateLibraries(array $libraries)
+ {
+ $expanded = [];
+
+ foreach ($libraries as $guid)
+ {
+ $guid = (string) $guid;
+ $type = GetHelper::var('library', $guid, 'guid', 'type');
+
+ if ((int) $type === 2)
+ {
+ $bundled = GetHelper::var('library', $guid, 'guid', 'libraries');
+
+ if (JsonHelper::check($bundled))
+ {
+ $bundled = json_decode($bundled, true);
+ }
+
+ if (UtilitiesArrayHelper::check($bundled))
+ {
+ foreach ($bundled as $lib)
+ {
+ $expanded[$lib] = $lib;
+ }
+ }
+ elseif (is_numeric($bundled))
+ {
+ $expanded[$bundled] = $bundled;
+ }
+ }
+ else
+ {
+ $expanded[$guid] = $guid;
+ }
+ }
+
+ // Remove invalid entries and duplicates
+ $valid = array_filter(array_unique($expanded), function ($guid) {
+ return GuidHelper::valid($guid);
+ });
+
+ return UtilitiesArrayHelper::check($valid) ? array_values($valid) : false;
+ }
+
+ /**
+ * Retrieves snippet details by GUID or ID.
+ *
+ * @param string|int $key The snippet GUID (string) or ID (int).
+ *
+ * @return object|false The snippet data object or false on failure.
+ * @since 5.1.1
+ */
+ public function getSnippetDetails($key)
+ {
+ $target = $this->resolveSnippetKeyField($key);
+
+ if ($target === false)
+ {
+ return false;
+ }
+
+ $db = Factory::getDbo();
+ $query = $db->getQuery(true);
+
+ $query
+ ->select($db->quoteName(
+ [
+ 'a.name',
+ 'a.heading',
+ 'a.usage',
+ 'a.description',
+ 'b.name',
+ 'a.snippet',
+ 'a.url',
+ 'c.name'
+ ],
+ [
+ 'name',
+ 'heading',
+ 'usage',
+ 'description',
+ 'type',
+ 'snippet',
+ 'url',
+ 'library'
+ ]
+ ))
+ ->from($db->quoteName('#__componentbuilder_snippet', 'a'))
+ ->join('LEFT', $db->quoteName('#__componentbuilder_snippet_type', 'b') . ' ON ' . $db->quoteName('a.type') . ' = ' . $db->quoteName('b.guid'))
+ ->join('LEFT', $db->quoteName('#__componentbuilder_library', 'c') . ' ON ' . $db->quoteName('a.library') . ' = ' . $db->quoteName('c.guid'))
+ ->where($db->quoteName('a.published') . ' >= 1')
+ ->where($db->quoteName("a.$target") . ' = ' . $db->quote($key));
+
+ $db->setQuery($query);
+ $db->execute();
+
+ if ($db->getNumRows() > 0)
+ {
+ $snippet = $db->loadObject();
+
+ if (isset($snippet->snippet))
+ {
+ $snippet->snippet = base64_decode($snippet->snippet);
+ }
+
+ return $snippet;
+ }
+
+ return false;
+ }
+
+ /**
+ * Resolves whether the given key is a GUID or numeric ID and returns the appropriate field.
+ *
+ * @param mixed $key The value used to identify the snippet.
+ *
+ * @return string|false 'guid', 'id', or false if invalid.
+ * @since 5.1.1
+ */
+ protected function resolveSnippetKeyField($key)
+ {
+ if (GuidHelper::valid($key))
+ {
+ return 'guid';
+ }
+
+ if (is_numeric($key))
+ {
+ return 'id';
+ }
+
+ return false;
}
// Used in validation_rule
@@ -5434,4 +5285,225 @@ class AjaxModel extends ListModel
return ['error' => Text::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
}
+
+ // Used in initialization_selection
+ /**
+ * Method to get the target power
+ *
+ * @return string|null
+ *
+ * @since 5.1.1
+ */
+ protected function getTargetAreaPower($power): ?string
+ {
+ return $this->powers[$power] ?? null;
+ }
+
+ /**
+ * Method to get the power get class
+ *
+ * @param string $repo The repo to list index
+ * @param string $area The target area
+ *
+ * @return array
+ * @since 5.1.1
+ */
+ public function getRepoIndex(string $repo, string $area): array
+ {
+ if (!GuidHelper::valid($repo))
+ {
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_INVALID_REPO_SELECTED')];
+ }
+
+ if (($Power = $this->getTargetAreaPower($area)) === null)
+ {
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_INVALID_AREA_SELECTED')];
+ }
+
+ try
+ {
+ $class = $this->getPowerClass($Power, "{$area}.Remote.Get");
+ if ($class !== null)
+ {
+ $result = $class->list($repo);
+ }
+ }
+ catch (\Exception $e)
+ {
+ return ['success' => false, 'message' => $e->getMessage()];
+ }
+
+ if (!empty($result))
+ {
+ foreach($result as &$values)
+ {
+ // ensure we don't leak the repo token
+ if (isset($values->token))
+ {
+ $values->token = '***redacted***';
+ }
+ }
+
+ return ['success' => true, 'index' => $result];
+ }
+
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_THE_REPO_INDEX_FAILED_TO_LOAD_PLEASE_TRY_AGAIN')];
+ }
+
+ /**
+ * Method to initialize the selected powers
+ *
+ * @param string $repo The repo to list index
+ * @param string $area The target area
+ * @param array $selected The selected powers
+ *
+ * @return array
+ * @since 5.1.1
+ */
+ public function initSelectedPowers(string $repo, string $area, array $selected): array
+ {
+ if (!GuidHelper::valid($repo))
+ {
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_INVALID_REPO_SELECTED')];
+ }
+
+ if (($Power = $this->getTargetAreaPower($area)) === null)
+ {
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_INVALID_AREA_SELECTED')];
+ }
+
+ $result = [];
+ try
+ {
+ $class = $this->getPowerClass($Power, "{$area}.Remote.Get");
+ if ($class !== null)
+ {
+ $repo_path = $class->path($repo);
+ $result = $class->init($selected, $repo_path);
+ }
+ }
+ catch (\Exception $e)
+ {
+ return ['success' => false, 'message' => $e->getMessage()];
+ }
+
+ if ($result !== [])
+ {
+ return ['success' => true, 'result_log' => $result];
+ }
+
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_THE_REPO_INDEX_FAILED_TO_LOAD_PLEASE_TRY_AGAIN')];
+ }
+
+ /**
+ * Method to initialize the selected packages
+ *
+ * @param string $repo The repo to list index
+ * @param string $area The target area
+ * @param array $selected The selected powers
+ *
+ * @return array
+ * @since 5.1.1
+ */
+ public function initSelectedPackages(string $repo, string $area, array $selected): array
+ {
+ if (!GuidHelper::valid($repo))
+ {
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_INVALID_REPO_SELECTED')];
+ }
+
+ if (($Power = $this->getTargetAreaPower($area)) === null)
+ {
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_INVALID_AREA_SELECTED')];
+ }
+
+ $result = [];
+ try
+ {
+ $class = $this->getPowerClass($Power, "Package.Builder.Get");
+ $entity = $this->getPowerClass($Power, "{$area}.Remote.Get");
+ if (!empty($selected) && $class !== null && $entity !== null)
+ {
+ $table = $entity->getTable();
+ $repo_path = $entity->path($repo);
+ $result = $class->init($table, $selected, $repo_path);
+ }
+ }
+ catch (\Exception $e)
+ {
+ return ['success' => false, 'message' => $e->getMessage()];
+ }
+
+ if ($this->hasIntResults($result))
+ {
+ return ['success' => true, 'result_log' => $result];
+ }
+
+ return ['success' => false, 'message' => Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_FAILED_PLEASE_TRY_AGAIN')];
+ }
+
+ /**
+ * Check if at least one key in the array has a non-empty value.
+ *
+ * @param array $data The result array (with 'local', 'not_found', 'added' keys)
+ *
+ * @return bool True if some values are non-empty; false if all are empty.
+ * @since 5.1.1
+ */
+ protected static function hasIntResults(array $data): bool
+ {
+ return (bool) array_filter($data);
+ }
+
+ /**
+ * The powers that we can initialize
+ *
+ * @var array
+ * @since 5.1.1
+ */
+ protected array $powers = [
+ 'AdminView' => 'PackageFactory',
+ 'Component' => 'PackageFactory',
+ 'CustomAdminView' => 'PackageFactory',
+ 'CustomCode' => 'PackageFactory',
+ 'DynamicGet' => 'PackageFactory',
+ 'Field' => 'PackageFactory',
+ 'Joomla.Fieldtype' => 'FieldtypeFactory',
+ 'Joomla.Power' => 'JoomlaPowerFactory',
+ 'Layout' => 'PackageFactory',
+ 'Library' => 'PackageFactory',
+ 'JoomlaModule' => 'PackageFactory',
+ 'JoomlaPlugin' => 'PackageFactory',
+ 'Power' => 'PowerFactory',
+ 'SiteView' => 'PackageFactory',
+ 'Snippet' => 'SnippetFactory',
+ 'Template' => 'PackageFactory',
+ 'ClassExtends' => 'PackageFactory',
+ 'ClassProperty' => 'PackageFactory',
+ 'ClassMethod' => 'PackageFactory',
+ 'Placeholder' => 'PackageFactory',
+ 'Repository' => 'RepositoryFactory'
+ ];
+
+ /**
+ * Method to get the power get class
+ *
+ * @param string $factoryName The factory name
+ * @param string $getClass The remote power class name
+ *
+ * @return mixed
+ * @since 5.1.1
+ */
+ protected function getPowerClass(string $factoryName, string $getClass)
+ {
+ return match ($factoryName) {
+ 'PowerFactory' => PowerFactory::_($getClass),
+ 'JoomlaPowerFactory' => JoomlaPowerFactory::_($getClass),
+ 'FieldtypeFactory' => FieldtypeFactory::_($getClass),
+ 'SnippetFactory' => SnippetFactory::_($getClass),
+ 'PackageFactory' => PackageFactory::_($getClass),
+ 'RepositoryFactory' => RepositoryFactory::_($getClass),
+ default => null,
+ };
+ }
}
diff --git a/admin/src/Model/CompilerModel.php b/admin/src/Model/CompilerModel.php
index a5d2b127f..95e1aa227 100644
--- a/admin/src/Model/CompilerModel.php
+++ b/admin/src/Model/CompilerModel.php
@@ -25,7 +25,7 @@ use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Componentbuilder\Compiler\Helper\Compiler;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\JsonHelper;
-use Joomla\CMS\Filesystem\Folder;
+use Joomla\Filesystem\Folder;
use Joomla\Filesystem\File;
use Joomla\CMS\Installer\InstallerHelper;
use Joomla\CMS\Installer\Installer;
diff --git a/admin/src/Model/ComponentbuilderModel.php b/admin/src/Model/ComponentbuilderModel.php
index fe643ec52..254d3b2be 100644
--- a/admin/src/Model/ComponentbuilderModel.php
+++ b/admin/src/Model/ComponentbuilderModel.php
@@ -38,6 +38,233 @@ use VDM\Joomla\Utilities\StringHelper;
*/
class ComponentbuilderModel extends ListModel
{
+ /**
+ * Represents the current user object.
+ *
+ * @var User The user object representing the current user.
+ * @since 3.2.0
+ */
+ protected User $user;
+
+ /**
+ * View groups of this component
+ *
+ * @var array
+ * @since 5.1.1
+ */
+ protected array $viewGroups = [
+ 'main' => ['png.compiler', 'png.joomla_components', 'png.joomla_modules', 'png.joomla_plugins', 'png.powers', 'png.search', 'png.admin_views', 'png.custom_admin_views', 'png.site_views', 'png.template.add', 'png.templates', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_field', 'png.fieldtypes', 'png.fieldtypes.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_fieldtype', 'png.language_translations', 'png.languages', 'png.servers', 'png.repositories', 'png.help_documents'],
+ ];
+
+ /**
+ * View access array.
+ *
+ * @var array
+ * @since 5.1.1
+ */
+ protected array $viewAccess = [
+ 'compiler.submenu' => 'compiler.submenu',
+ 'compiler.dashboard_list' => 'compiler.dashboard_list',
+ 'search.access' => 'search.access',
+ 'search.submenu' => 'search.submenu',
+ 'search.dashboard_list' => 'search.dashboard_list',
+ 'joomla_component.create' => 'joomla_component.create',
+ 'joomla_components.access' => 'joomla_component.access',
+ 'joomla_component.access' => 'joomla_component.access',
+ 'joomla_components.submenu' => 'joomla_component.submenu',
+ 'joomla_components.dashboard_list' => 'joomla_component.dashboard_list',
+ 'joomla_module.create' => 'joomla_module.create',
+ 'joomla_modules.access' => 'joomla_module.access',
+ 'joomla_module.access' => 'joomla_module.access',
+ 'joomla_modules.submenu' => 'joomla_module.submenu',
+ 'joomla_modules.dashboard_list' => 'joomla_module.dashboard_list',
+ 'joomla_plugin.create' => 'joomla_plugin.create',
+ 'joomla_plugins.access' => 'joomla_plugin.access',
+ 'joomla_plugin.access' => 'joomla_plugin.access',
+ 'joomla_plugins.submenu' => 'joomla_plugin.submenu',
+ 'joomla_plugins.dashboard_list' => 'joomla_plugin.dashboard_list',
+ 'joomla_power.create' => 'joomla_power.create',
+ 'joomla_powers.access' => 'joomla_power.access',
+ 'joomla_power.access' => 'joomla_power.access',
+ 'joomla_powers.submenu' => 'joomla_power.submenu',
+ 'power.create' => 'power.create',
+ 'powers.access' => 'power.access',
+ 'power.access' => 'power.access',
+ 'powers.submenu' => 'power.submenu',
+ 'powers.dashboard_list' => 'power.dashboard_list',
+ 'admin_view.create' => 'admin_view.create',
+ 'admin_views.access' => 'admin_view.access',
+ 'admin_view.access' => 'admin_view.access',
+ 'admin_views.submenu' => 'admin_view.submenu',
+ 'admin_views.dashboard_list' => 'admin_view.dashboard_list',
+ 'custom_admin_views.access' => 'custom_admin_view.access',
+ 'custom_admin_view.access' => 'custom_admin_view.access',
+ 'custom_admin_views.submenu' => 'custom_admin_view.submenu',
+ 'custom_admin_views.dashboard_list' => 'custom_admin_view.dashboard_list',
+ 'site_views.access' => 'site_view.access',
+ 'site_view.access' => 'site_view.access',
+ 'site_views.submenu' => 'site_view.submenu',
+ 'site_views.dashboard_list' => 'site_view.dashboard_list',
+ 'templates.access' => 'template.access',
+ 'template.access' => 'template.access',
+ 'templates.submenu' => 'template.submenu',
+ 'templates.dashboard_list' => 'template.dashboard_list',
+ 'template.dashboard_add' => 'template.dashboard_add',
+ 'layouts.access' => 'layout.access',
+ 'layout.access' => 'layout.access',
+ 'layouts.submenu' => 'layout.submenu',
+ 'layouts.dashboard_list' => 'layout.dashboard_list',
+ 'dynamic_get.create' => 'dynamic_get.create',
+ 'dynamic_gets.access' => 'dynamic_get.access',
+ 'dynamic_get.access' => 'dynamic_get.access',
+ 'dynamic_gets.submenu' => 'dynamic_get.submenu',
+ 'dynamic_gets.dashboard_list' => 'dynamic_get.dashboard_list',
+ 'dynamic_get.dashboard_add' => 'dynamic_get.dashboard_add',
+ 'custom_code.create' => 'custom_code.create',
+ 'custom_codes.access' => 'custom_code.access',
+ 'custom_code.access' => 'custom_code.access',
+ 'custom_codes.submenu' => 'custom_code.submenu',
+ 'custom_codes.dashboard_list' => 'custom_code.dashboard_list',
+ 'class_extends.create' => 'class_extends.create',
+ 'class_extendings.access' => 'class_extends.access',
+ 'class_extends.access' => 'class_extends.access',
+ 'class_property.create' => 'class_property.create',
+ 'class_properties.access' => 'class_property.access',
+ 'class_property.access' => 'class_property.access',
+ 'class_method.create' => 'class_method.create',
+ 'class_methods.access' => 'class_method.access',
+ 'class_method.access' => 'class_method.access',
+ 'placeholder.create' => 'placeholder.create',
+ 'placeholders.access' => 'placeholder.access',
+ 'placeholder.access' => 'placeholder.access',
+ 'placeholders.submenu' => 'placeholder.submenu',
+ 'placeholders.dashboard_list' => 'placeholder.dashboard_list',
+ 'library.create' => 'library.create',
+ 'libraries.access' => 'library.access',
+ 'library.access' => 'library.access',
+ 'libraries.submenu' => 'library.submenu',
+ 'libraries.dashboard_list' => 'library.dashboard_list',
+ 'snippets.access' => 'snippet.access',
+ 'snippet.access' => 'snippet.access',
+ 'snippets.submenu' => 'snippet.submenu',
+ 'snippets.dashboard_list' => 'snippet.dashboard_list',
+ 'validation_rule.create' => 'validation_rule.create',
+ 'validation_rules.access' => 'validation_rule.access',
+ 'validation_rule.access' => 'validation_rule.access',
+ 'validation_rules.submenu' => 'validation_rule.submenu',
+ 'validation_rules.dashboard_list' => 'validation_rule.dashboard_list',
+ 'field.create' => 'field.create',
+ 'fields.access' => 'field.access',
+ 'field.access' => 'field.access',
+ 'fields.submenu' => 'field.submenu',
+ 'fields.dashboard_list' => 'field.dashboard_list',
+ 'field.dashboard_add' => 'field.dashboard_add',
+ 'fieldtype.create' => 'fieldtype.create',
+ 'fieldtypes.access' => 'fieldtype.access',
+ 'fieldtype.access' => 'fieldtype.access',
+ 'fieldtypes.submenu' => 'fieldtype.submenu',
+ 'fieldtypes.dashboard_list' => 'fieldtype.dashboard_list',
+ 'language_translation.create' => 'language_translation.create',
+ 'language_translations.access' => 'language_translation.access',
+ 'language_translation.access' => 'language_translation.access',
+ 'language_translations.submenu' => 'language_translation.submenu',
+ 'language_translations.dashboard_list' => 'language_translation.dashboard_list',
+ 'language.create' => 'language.create',
+ 'languages.access' => 'language.access',
+ 'language.access' => 'language.access',
+ 'languages.submenu' => 'language.submenu',
+ 'languages.dashboard_list' => 'language.dashboard_list',
+ 'server.create' => 'server.create',
+ 'servers.access' => 'server.access',
+ 'server.access' => 'server.access',
+ 'servers.submenu' => 'server.submenu',
+ 'servers.dashboard_list' => 'server.dashboard_list',
+ 'repository.create' => 'repository.create',
+ 'repositories.access' => 'repository.access',
+ 'repository.access' => 'repository.access',
+ 'repositories.submenu' => 'repository.submenu',
+ 'repositories.dashboard_list' => 'repository.dashboard_list',
+ 'help_document.create' => 'help_document.create',
+ 'help_documents.access' => 'help_document.access',
+ 'help_document.access' => 'help_document.access',
+ 'help_documents.submenu' => 'help_document.submenu',
+ 'help_documents.dashboard_list' => 'help_document.dashboard_list',
+ 'admin_fields.create' => 'admin_fields.create',
+ 'admins_fields.access' => 'admin_fields.access',
+ 'admin_fields.access' => 'admin_fields.access',
+ 'admin_fields_conditions.create' => 'admin_fields_conditions.create',
+ 'admins_fields_conditions.access' => 'admin_fields_conditions.access',
+ 'admin_fields_conditions.access' => 'admin_fields_conditions.access',
+ 'admin_fields_relations.create' => 'admin_fields_relations.create',
+ 'admins_fields_relations.access' => 'admin_fields_relations.access',
+ 'admin_fields_relations.access' => 'admin_fields_relations.access',
+ 'admin_custom_tabs.create' => 'admin_custom_tabs.create',
+ 'admins_custom_tabs.access' => 'admin_custom_tabs.access',
+ 'admin_custom_tabs.access' => 'admin_custom_tabs.access',
+ 'component_admin_views.create' => 'component_admin_views.create',
+ 'components_admin_views.access' => 'component_admin_views.access',
+ 'component_admin_views.access' => 'component_admin_views.access',
+ 'component_site_views.create' => 'component_site_views.create',
+ 'components_site_views.access' => 'component_site_views.access',
+ 'component_site_views.access' => 'component_site_views.access',
+ 'component_custom_admin_views.create' => 'component_custom_admin_views.create',
+ 'components_custom_admin_views.access' => 'component_custom_admin_views.access',
+ 'component_custom_admin_views.access' => 'component_custom_admin_views.access',
+ 'component_updates.create' => 'component_updates.create',
+ 'components_updates.access' => 'component_updates.access',
+ 'component_updates.access' => 'component_updates.access',
+ 'component_mysql_tweaks.create' => 'component_mysql_tweaks.create',
+ 'components_mysql_tweaks.access' => 'component_mysql_tweaks.access',
+ 'component_mysql_tweaks.access' => 'component_mysql_tweaks.access',
+ 'component_custom_admin_menus.create' => 'component_custom_admin_menus.create',
+ 'components_custom_admin_menus.access' => 'component_custom_admin_menus.access',
+ 'component_custom_admin_menus.access' => 'component_custom_admin_menus.access',
+ 'component_router.create' => 'component_router.create',
+ 'components_routers.access' => 'component_router.access',
+ 'component_router.access' => 'component_router.access',
+ 'component_config.create' => 'component_config.create',
+ 'components_config.access' => 'component_config.access',
+ 'component_config.access' => 'component_config.access',
+ 'component_dashboard.create' => 'component_dashboard.create',
+ 'components_dashboard.access' => 'component_dashboard.access',
+ 'component_dashboard.access' => 'component_dashboard.access',
+ 'component_files_folders.create' => 'component_files_folders.create',
+ 'components_files_folders.access' => 'component_files_folders.access',
+ 'component_files_folders.access' => 'component_files_folders.access',
+ 'component_placeholders.create' => 'component_placeholders.create',
+ 'components_placeholders.access' => 'component_placeholders.access',
+ 'component_placeholders.access' => 'component_placeholders.access',
+ 'component_plugins.create' => 'component_plugins.create',
+ 'components_plugins.access' => 'component_plugins.access',
+ 'component_plugins.access' => 'component_plugins.access',
+ 'component_modules.create' => 'component_modules.create',
+ 'components_modules.access' => 'component_modules.access',
+ 'component_modules.access' => 'component_modules.access',
+ 'snippet_type.create' => 'snippet_type.create',
+ 'snippet_types.access' => 'snippet_type.access',
+ 'snippet_type.access' => 'snippet_type.access',
+ 'library_config.create' => 'library_config.create',
+ 'libraries_config.access' => 'library_config.access',
+ 'library_config.access' => 'library_config.access',
+ 'library_files_folders_urls.create' => 'library_files_folders_urls.create',
+ 'libraries_files_folders_urls.access' => 'library_files_folders_urls.access',
+ 'library_files_folders_urls.access' => 'library_files_folders_urls.access',
+ 'joomla_module_updates.create' => 'joomla_module_updates.create',
+ 'joomla_modules_updates.access' => 'joomla_module_updates.access',
+ 'joomla_module_updates.access' => 'joomla_module_updates.access',
+ 'joomla_module_files_folders_urls.create' => 'joomla_module_files_folders_urls.create',
+ 'joomla_modules_files_folders_urls.access' => 'joomla_module_files_folders_urls.access',
+ 'joomla_module_files_folders_urls.access' => 'joomla_module_files_folders_urls.access',
+ 'joomla_plugin_groups.access' => 'joomla_plugin_group.access',
+ 'joomla_plugin_group.access' => 'joomla_plugin_group.access',
+ 'joomla_plugin_updates.create' => 'joomla_plugin_updates.create',
+ 'joomla_plugins_updates.access' => 'joomla_plugin_updates.access',
+ 'joomla_plugin_updates.access' => 'joomla_plugin_updates.access',
+ 'joomla_plugin_files_folders_urls.create' => 'joomla_plugin_files_folders_urls.create',
+ 'joomla_plugins_files_folders_urls.access' => 'joomla_plugin_files_folders_urls.access',
+ 'joomla_plugin_files_folders_urls.access' => 'joomla_plugin_files_folders_urls.access',
+ ];
+
/**
* The styles array.
*
@@ -59,402 +286,50 @@ class ComponentbuilderModel extends ListModel
'administrator/components/com_componentbuilder/assets/js/admin.js'
];
- public function getIcons()
+ /**
+ * Constructor
+ *
+ * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
+ * @param ?MVCFactoryInterface $factory The factory.
+ *
+ * @since 1.6
+ * @throws \Exception
+ */
+ public function __construct($config = [], MVCFactoryInterface $factory = null)
{
- // load user for access menus
- $user = Factory::getApplication()->getIdentity();
- // reset icon array
- $icons = [];
- // view groups array
- $viewGroups = array(
- 'main' => array('png.compiler', 'png.joomla_components', 'png.joomla_modules', 'png.joomla_plugins', 'png.powers', 'png.search', 'png.admin_views', 'png.custom_admin_views', 'png.site_views', 'png.template.add', 'png.templates', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_field', 'png.fieldtypes', 'png.fieldtypes.catid_qpo0O0oqp_com_componentbuilder_po0O0oq_fieldtype', 'png.language_translations', 'png.languages', 'png.servers', 'png.repositories', 'png.help_documents')
- );
- // view access array
- $viewAccess = [
- 'compiler.submenu' => 'compiler.submenu',
- 'compiler.dashboard_list' => 'compiler.dashboard_list',
- 'search.access' => 'search.access',
- 'search.submenu' => 'search.submenu',
- 'search.dashboard_list' => 'search.dashboard_list',
- 'joomla_component.create' => 'joomla_component.create',
- 'joomla_components.access' => 'joomla_component.access',
- 'joomla_component.access' => 'joomla_component.access',
- 'joomla_components.submenu' => 'joomla_component.submenu',
- 'joomla_components.dashboard_list' => 'joomla_component.dashboard_list',
- 'joomla_module.create' => 'joomla_module.create',
- 'joomla_modules.access' => 'joomla_module.access',
- 'joomla_module.access' => 'joomla_module.access',
- 'joomla_modules.submenu' => 'joomla_module.submenu',
- 'joomla_modules.dashboard_list' => 'joomla_module.dashboard_list',
- 'joomla_plugin.create' => 'joomla_plugin.create',
- 'joomla_plugins.access' => 'joomla_plugin.access',
- 'joomla_plugin.access' => 'joomla_plugin.access',
- 'joomla_plugins.submenu' => 'joomla_plugin.submenu',
- 'joomla_plugins.dashboard_list' => 'joomla_plugin.dashboard_list',
- 'joomla_power.create' => 'joomla_power.create',
- 'joomla_powers.access' => 'joomla_power.access',
- 'joomla_power.access' => 'joomla_power.access',
- 'joomla_powers.submenu' => 'joomla_power.submenu',
- 'power.create' => 'power.create',
- 'powers.access' => 'power.access',
- 'power.access' => 'power.access',
- 'powers.submenu' => 'power.submenu',
- 'powers.dashboard_list' => 'power.dashboard_list',
- 'admin_view.create' => 'admin_view.create',
- 'admin_views.access' => 'admin_view.access',
- 'admin_view.access' => 'admin_view.access',
- 'admin_views.submenu' => 'admin_view.submenu',
- 'admin_views.dashboard_list' => 'admin_view.dashboard_list',
- 'custom_admin_views.access' => 'custom_admin_view.access',
- 'custom_admin_view.access' => 'custom_admin_view.access',
- 'custom_admin_views.submenu' => 'custom_admin_view.submenu',
- 'custom_admin_views.dashboard_list' => 'custom_admin_view.dashboard_list',
- 'site_views.access' => 'site_view.access',
- 'site_view.access' => 'site_view.access',
- 'site_views.submenu' => 'site_view.submenu',
- 'site_views.dashboard_list' => 'site_view.dashboard_list',
- 'templates.access' => 'template.access',
- 'template.access' => 'template.access',
- 'templates.submenu' => 'template.submenu',
- 'templates.dashboard_list' => 'template.dashboard_list',
- 'template.dashboard_add' => 'template.dashboard_add',
- 'layouts.access' => 'layout.access',
- 'layout.access' => 'layout.access',
- 'layouts.submenu' => 'layout.submenu',
- 'layouts.dashboard_list' => 'layout.dashboard_list',
- 'dynamic_get.create' => 'dynamic_get.create',
- 'dynamic_gets.access' => 'dynamic_get.access',
- 'dynamic_get.access' => 'dynamic_get.access',
- 'dynamic_gets.submenu' => 'dynamic_get.submenu',
- 'dynamic_gets.dashboard_list' => 'dynamic_get.dashboard_list',
- 'dynamic_get.dashboard_add' => 'dynamic_get.dashboard_add',
- 'custom_code.create' => 'custom_code.create',
- 'custom_codes.access' => 'custom_code.access',
- 'custom_code.access' => 'custom_code.access',
- 'custom_codes.submenu' => 'custom_code.submenu',
- 'custom_codes.dashboard_list' => 'custom_code.dashboard_list',
- 'class_property.create' => 'class_property.create',
- 'class_properties.access' => 'class_property.access',
- 'class_property.access' => 'class_property.access',
- 'class_method.create' => 'class_method.create',
- 'class_methods.access' => 'class_method.access',
- 'class_method.access' => 'class_method.access',
- 'placeholder.create' => 'placeholder.create',
- 'placeholders.access' => 'placeholder.access',
- 'placeholder.access' => 'placeholder.access',
- 'placeholders.submenu' => 'placeholder.submenu',
- 'placeholders.dashboard_list' => 'placeholder.dashboard_list',
- 'library.create' => 'library.create',
- 'libraries.access' => 'library.access',
- 'library.access' => 'library.access',
- 'libraries.submenu' => 'library.submenu',
- 'libraries.dashboard_list' => 'library.dashboard_list',
- 'snippets.access' => 'snippet.access',
- 'snippet.access' => 'snippet.access',
- 'snippets.submenu' => 'snippet.submenu',
- 'snippets.dashboard_list' => 'snippet.dashboard_list',
- 'validation_rule.create' => 'validation_rule.create',
- 'validation_rules.access' => 'validation_rule.access',
- 'validation_rule.access' => 'validation_rule.access',
- 'validation_rules.submenu' => 'validation_rule.submenu',
- 'validation_rules.dashboard_list' => 'validation_rule.dashboard_list',
- 'field.create' => 'field.create',
- 'fields.access' => 'field.access',
- 'field.access' => 'field.access',
- 'fields.submenu' => 'field.submenu',
- 'fields.dashboard_list' => 'field.dashboard_list',
- 'field.dashboard_add' => 'field.dashboard_add',
- 'fieldtype.create' => 'fieldtype.create',
- 'fieldtypes.access' => 'fieldtype.access',
- 'fieldtype.access' => 'fieldtype.access',
- 'fieldtypes.submenu' => 'fieldtype.submenu',
- 'fieldtypes.dashboard_list' => 'fieldtype.dashboard_list',
- 'language_translation.create' => 'language_translation.create',
- 'language_translations.access' => 'language_translation.access',
- 'language_translation.access' => 'language_translation.access',
- 'language_translations.submenu' => 'language_translation.submenu',
- 'language_translations.dashboard_list' => 'language_translation.dashboard_list',
- 'language.create' => 'language.create',
- 'languages.access' => 'language.access',
- 'language.access' => 'language.access',
- 'languages.submenu' => 'language.submenu',
- 'languages.dashboard_list' => 'language.dashboard_list',
- 'server.create' => 'server.create',
- 'servers.access' => 'server.access',
- 'server.access' => 'server.access',
- 'servers.submenu' => 'server.submenu',
- 'servers.dashboard_list' => 'server.dashboard_list',
- 'repository.create' => 'repository.create',
- 'repositories.access' => 'repository.access',
- 'repository.access' => 'repository.access',
- 'repositories.submenu' => 'repository.submenu',
- 'repositories.dashboard_list' => 'repository.dashboard_list',
- 'help_document.create' => 'help_document.create',
- 'help_documents.access' => 'help_document.access',
- 'help_document.access' => 'help_document.access',
- 'help_documents.submenu' => 'help_document.submenu',
- 'help_documents.dashboard_list' => 'help_document.dashboard_list',
- 'admin_fields.create' => 'admin_fields.create',
- 'admins_fields.access' => 'admin_fields.access',
- 'admin_fields.access' => 'admin_fields.access',
- 'admin_fields_conditions.create' => 'admin_fields_conditions.create',
- 'admins_fields_conditions.access' => 'admin_fields_conditions.access',
- 'admin_fields_conditions.access' => 'admin_fields_conditions.access',
- 'admin_fields_relations.create' => 'admin_fields_relations.create',
- 'admins_fields_relations.access' => 'admin_fields_relations.access',
- 'admin_fields_relations.access' => 'admin_fields_relations.access',
- 'admin_custom_tabs.create' => 'admin_custom_tabs.create',
- 'admins_custom_tabs.access' => 'admin_custom_tabs.access',
- 'admin_custom_tabs.access' => 'admin_custom_tabs.access',
- 'component_admin_views.create' => 'component_admin_views.create',
- 'components_admin_views.access' => 'component_admin_views.access',
- 'component_admin_views.access' => 'component_admin_views.access',
- 'component_site_views.create' => 'component_site_views.create',
- 'components_site_views.access' => 'component_site_views.access',
- 'component_site_views.access' => 'component_site_views.access',
- 'component_custom_admin_views.create' => 'component_custom_admin_views.create',
- 'components_custom_admin_views.access' => 'component_custom_admin_views.access',
- 'component_custom_admin_views.access' => 'component_custom_admin_views.access',
- 'component_updates.create' => 'component_updates.create',
- 'components_updates.access' => 'component_updates.access',
- 'component_updates.access' => 'component_updates.access',
- 'component_mysql_tweaks.create' => 'component_mysql_tweaks.create',
- 'components_mysql_tweaks.access' => 'component_mysql_tweaks.access',
- 'component_mysql_tweaks.access' => 'component_mysql_tweaks.access',
- 'component_custom_admin_menus.create' => 'component_custom_admin_menus.create',
- 'components_custom_admin_menus.access' => 'component_custom_admin_menus.access',
- 'component_custom_admin_menus.access' => 'component_custom_admin_menus.access',
- 'component_router.create' => 'component_router.create',
- 'components_routers.access' => 'component_router.access',
- 'component_router.access' => 'component_router.access',
- 'component_config.create' => 'component_config.create',
- 'components_config.access' => 'component_config.access',
- 'component_config.access' => 'component_config.access',
- 'component_dashboard.create' => 'component_dashboard.create',
- 'components_dashboard.access' => 'component_dashboard.access',
- 'component_dashboard.access' => 'component_dashboard.access',
- 'component_files_folders.create' => 'component_files_folders.create',
- 'components_files_folders.access' => 'component_files_folders.access',
- 'component_files_folders.access' => 'component_files_folders.access',
- 'component_placeholders.create' => 'component_placeholders.create',
- 'components_placeholders.access' => 'component_placeholders.access',
- 'component_placeholders.access' => 'component_placeholders.access',
- 'component_plugins.create' => 'component_plugins.create',
- 'components_plugins.access' => 'component_plugins.access',
- 'component_plugins.access' => 'component_plugins.access',
- 'component_modules.create' => 'component_modules.create',
- 'components_modules.access' => 'component_modules.access',
- 'component_modules.access' => 'component_modules.access',
- 'snippet_type.create' => 'snippet_type.create',
- 'snippet_types.access' => 'snippet_type.access',
- 'snippet_type.access' => 'snippet_type.access',
- 'library_config.create' => 'library_config.create',
- 'libraries_config.access' => 'library_config.access',
- 'library_config.access' => 'library_config.access',
- 'library_files_folders_urls.create' => 'library_files_folders_urls.create',
- 'libraries_files_folders_urls.access' => 'library_files_folders_urls.access',
- 'library_files_folders_urls.access' => 'library_files_folders_urls.access',
- 'class_extends.create' => 'class_extends.create',
- 'class_extendings.access' => 'class_extends.access',
- 'class_extends.access' => 'class_extends.access',
- 'joomla_module_updates.create' => 'joomla_module_updates.create',
- 'joomla_modules_updates.access' => 'joomla_module_updates.access',
- 'joomla_module_updates.access' => 'joomla_module_updates.access',
- 'joomla_module_files_folders_urls.create' => 'joomla_module_files_folders_urls.create',
- 'joomla_modules_files_folders_urls.access' => 'joomla_module_files_folders_urls.access',
- 'joomla_module_files_folders_urls.access' => 'joomla_module_files_folders_urls.access',
- 'joomla_plugin_groups.access' => 'joomla_plugin_group.access',
- 'joomla_plugin_group.access' => 'joomla_plugin_group.access',
- 'joomla_plugin_updates.create' => 'joomla_plugin_updates.create',
- 'joomla_plugins_updates.access' => 'joomla_plugin_updates.access',
- 'joomla_plugin_updates.access' => 'joomla_plugin_updates.access',
- 'joomla_plugin_files_folders_urls.create' => 'joomla_plugin_files_folders_urls.create',
- 'joomla_plugins_files_folders_urls.access' => 'joomla_plugin_files_folders_urls.access',
- 'joomla_plugin_files_folders_urls.access' => 'joomla_plugin_files_folders_urls.access',
- ];
- // loop over the $views
- foreach($viewGroups as $group => $views)
+ parent::__construct($config, $factory);
+
+ $this->user ??= $this->getCurrentUser();
+ }
+
+ /**
+ * Get dashboard icons, grouped by view sections.
+ *
+ * @return array>
+ * @since 5.1.1
+ */
+ public function getIcons(): array
+ {
+ $icons = [];
+
+ foreach ($this->viewGroups as $group => $views)
{
- $i = 0;
- if (UtilitiesArrayHelper::check($views))
+ if (!UtilitiesArrayHelper::check($views))
{
- foreach($views as $view)
+ $icons[$group][] = false;
+ continue;
+ }
+
+ foreach ($views as $view)
+ {
+ $icon = $this->buildIconObject($view);
+ if ($icon !== null)
{
- $add = false;
- // external views (links)
- if (strpos($view,'||') !== false)
- {
- $dwd = explode('||', $view);
- if (count($dwd) == 3)
- {
- list($type, $name, $url) = $dwd;
- $viewName = $name;
- $alt = $name;
- $url = $url;
- $image = $name . '.' . $type;
- $name = 'COM_COMPONENTBUILDER_DASHBOARD_' . StringHelper::safe($name,'U');
- }
- }
- // internal views
- elseif (strpos($view,'.') !== false)
- {
- $dwd = explode('.', $view);
- if (count($dwd) == 3)
- {
- list($type, $name, $action) = $dwd;
- }
- elseif (count($dwd) == 2)
- {
- list($type, $name) = $dwd;
- $action = false;
- }
- if ($action)
- {
- $viewName = $name;
- switch($action)
- {
- case 'add':
- $url = 'index.php?option=com_componentbuilder&view=' . $name . '&layout=edit';
- $image = $name . '_' . $action. '.' . $type;
- $alt = $name . ' ' . $action;
- $name = 'COM_COMPONENTBUILDER_DASHBOARD_'.StringHelper::safe($name,'U').'_ADD';
- $add = true;
- break;
- default:
- // check for new convention (more stable)
- if (strpos($action, '_qpo0O0oqp_') !== false)
- {
- list($action, $extension) = (array) explode('_qpo0O0oqp_', $action);
- $extension = str_replace('_po0O0oq_', '.', $extension);
- }
- else
- {
- $extension = 'com_componentbuilder.' . $name;
- }
- $url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
- $image = $name . '_' . $action . '.' . $type;
- $alt = $viewName . ' ' . $action;
- $name = 'COM_COMPONENTBUILDER_DASHBOARD_' . StringHelper::safe($name,'U') . '_' . StringHelper::safe($action,'U');
- break;
- }
- }
- else
- {
- $viewName = $name;
- $alt = $name;
- $url = 'index.php?option=com_componentbuilder&view=' . $name;
- $image = $name . '.' . $type;
- $name = 'COM_COMPONENTBUILDER_DASHBOARD_' . StringHelper::safe($name,'U');
- $hover = false;
- }
- }
- else
- {
- $viewName = $view;
- $alt = $view;
- $url = 'index.php?option=com_componentbuilder&view=' . $view;
- $image = $view . '.png';
- $name = ucwords($view).' ';
- $hover = false;
- }
- // first make sure the view access is set
- if (UtilitiesArrayHelper::check($viewAccess))
- {
- // setup some defaults
- $dashboard_add = false;
- $dashboard_list = false;
- $accessTo = '';
- $accessAdd = '';
- // access checking start
- $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? StringHelper::check($viewAccess[$viewName.'.create']):false;
- $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? StringHelper::check($viewAccess[$viewName.'.access']):false;
- // set main controllers
- $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? StringHelper::check($viewAccess[$viewName.'.dashboard_add']):false;
- $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? StringHelper::check($viewAccess[$viewName.'.dashboard_list']):false;
- // check for adding access
- if ($add && $accessCreate)
- {
- $accessAdd = $viewAccess[$viewName.'.create'];
- }
- elseif ($add)
- {
- $accessAdd = 'core.create';
- }
- // check if access to view is set
- if ($accessAccess)
- {
- $accessTo = $viewAccess[$viewName.'.access'];
- }
- // set main access controllers
- if ($accessDashboard_add)
- {
- $dashboard_add = $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_componentbuilder');
- }
- if ($accessDashboard_list)
- {
- $dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_componentbuilder');
- }
- if (StringHelper::check($accessAdd) && StringHelper::check($accessTo))
- {
- // check access
- if($user->authorise($accessAdd, 'com_componentbuilder') && $user->authorise($accessTo, 'com_componentbuilder') && $dashboard_add)
- {
- $icons[$group][$i] = new \StdClass;
- $icons[$group][$i]->url = $url;
- $icons[$group][$i]->name = $name;
- $icons[$group][$i]->image = $image;
- $icons[$group][$i]->alt = $alt;
- }
- }
- elseif (StringHelper::check($accessTo))
- {
- // check access
- if($user->authorise($accessTo, 'com_componentbuilder') && $dashboard_list)
- {
- $icons[$group][$i] = new \StdClass;
- $icons[$group][$i]->url = $url;
- $icons[$group][$i]->name = $name;
- $icons[$group][$i]->image = $image;
- $icons[$group][$i]->alt = $alt;
- }
- }
- elseif (StringHelper::check($accessAdd))
- {
- // check access
- if($user->authorise($accessAdd, 'com_componentbuilder') && $dashboard_add)
- {
- $icons[$group][$i] = new \StdClass;
- $icons[$group][$i]->url = $url;
- $icons[$group][$i]->name = $name;
- $icons[$group][$i]->image = $image;
- $icons[$group][$i]->alt = $alt;
- }
- }
- else
- {
- $icons[$group][$i] = new \StdClass;
- $icons[$group][$i]->url = $url;
- $icons[$group][$i]->name = $name;
- $icons[$group][$i]->image = $image;
- $icons[$group][$i]->alt = $alt;
- }
- }
- else
- {
- $icons[$group][$i] = new \StdClass;
- $icons[$group][$i]->url = $url;
- $icons[$group][$i]->name = $name;
- $icons[$group][$i]->image = $image;
- $icons[$group][$i]->alt = $alt;
- }
- $i++;
+ $icons[$group][] = $icon;
}
}
- else
- {
- $icons[$group][$i] = false;
- }
}
+
return $icons;
}
@@ -502,13 +377,208 @@ class ComponentbuilderModel extends ListModel
$this->scripts[] = $path;
}
+ /**
+ * Build a single dashboard icon if access is granted.
+ *
+ * @param string $view The view string to parse.
+ *
+ * @return \stdClass|null The icon object or null if access denied.
+ * @since 5.1.1
+ */
+ protected function buildIconObject(string $view): ?\stdClass
+ {
+ $parsed = $this->parseViewDefinition($view);
+ if (!$parsed)
+ {
+ return null;
+ }
+ [
+ 'type' => $type,
+ 'name' => $name,
+ 'url' => $url,
+ 'image' => $image,
+ 'alt' => $alt,
+ 'viewName' => $viewName,
+ 'add' => $add,
+ ] = $parsed;
+
+ if (!$this->hasAccessToView($viewName, $add))
+ {
+ return null;
+ }
+
+ return $this->createIconObject($url, $name, $image, $alt);
+ }
+
+ /**
+ * Parse a view string into structured components.
+ *
+ * @param string $view The view definition string.
+ *
+ * @return array|null Parsed values or null on failure.
+ * @since 5.1.1
+ */
+ protected function parseViewDefinition(string $view): ?array
+ {
+ $add = false;
+
+ if (strpos($view, '||') !== false)
+ {
+ $parts = explode('||', $view);
+ if (count($parts) === 3)
+ {
+ [$type, $name, $url] = $parts;
+ return [
+ 'type' => $type,
+ 'name' => 'COM_COMPONENTBUILDER_DASHBOARD_' . StringHelper::safe($name, 'U'),
+ 'url' => $url,
+ 'image' => "{$name}.{$type}",
+ 'alt' => $name,
+ 'viewName' => $name,
+ 'add' => false,
+ ];
+ }
+ }
+
+ if (strpos($view, '.') !== false)
+ {
+ $parts = explode('.', $view);
+ $type = $parts[0] ?? '';
+ $name = $parts[1] ?? '';
+ $action = $parts[2] ?? null;
+ $viewName = $name;
+
+ if ($action)
+ {
+ if ($action === 'add')
+ {
+ $url = "index.php?option=com_componentbuilder&view={$name}&layout=edit";
+ $image = "{$name}_{$action}.{$type}";
+ $alt = "{$name} {$action}";
+ $name = 'COM_COMPONENTBUILDER_DASHBOARD_' .
+ StringHelper::safe($name, 'U') . '_ADD';
+ $add = true;
+ }
+ else
+ {
+ if (strpos($action, '_qpo0O0oqp_') !== false)
+ {
+ [$action, $ext] = explode('_qpo0O0oqp_', $action);
+ $extension = str_replace('_po0O0oq_', '.', $ext);
+ }
+ else
+ {
+ $extension = "com_componentbuilder.{$name}";
+ }
+ $url = "index.php?option=com_categories&view=categories&extension={$extension}";
+ $image = "{$name}_{$action}.{$type}";
+ $alt = "{$name} {$action}";
+ $name = 'COM_COMPONENTBUILDER_DASHBOARD_' .
+ StringHelper::safe($name, 'U') . '_' .
+ StringHelper::safe($action, 'U');
+ }
+ }
+ else
+ {
+ $url = "index.php?option=com_componentbuilder&view={$name}";
+ $image = "{$name}.{$type}";
+ $alt = $name;
+ $name = 'COM_COMPONENTBUILDER_DASHBOARD_' .
+ StringHelper::safe($name, 'U');
+ }
+
+ return compact('type', 'name', 'url', 'image', 'alt', 'viewName', 'add');
+ }
+
+ return [
+ 'type' => 'png',
+ 'name' => ucwords($view) . ' ',
+ 'url' => "index.php?option=com_componentbuilder&view={$view}",
+ 'image' => "{$view}.png",
+ 'alt' => $view,
+ 'viewName' => $view,
+ 'add' => false,
+ ];
+ }
+
+ /**
+ * Determine if the user has access to view or create the item.
+ *
+ * @param string $viewName The base name of the view.
+ * @param bool $add If this is an add-action.
+ *
+ * @return bool
+ * @since 5.1.1
+ */
+ protected function hasAccessToView(string $viewName, bool $add): bool
+ {
+ $viewAccess = $this->viewAccess;
+ $accessAdd = $add && isset($viewAccess["{$viewName}.create"])
+ ? $viewAccess["{$viewName}.create"]
+ : ($add ? 'core.create' : '');
+
+ $accessTo = $viewAccess["{$viewName}.access"] ?? '';
+
+ $dashboardAdd = isset($viewAccess["{$viewName}.dashboard_add"]) &&
+ $this->user->authorise($viewAccess["{$viewName}.dashboard_add"], 'com_componentbuilder');
+
+ $dashboardList = isset($viewAccess["{$viewName}.dashboard_list"]) &&
+ $this->user->authorise($viewAccess["{$viewName}.dashboard_list"], 'com_componentbuilder');
+
+ if ($add && StringHelper::check($accessAdd))
+ {
+ return $this->user->authorise($accessAdd, 'com_componentbuilder') && $dashboardAdd;
+ }
+
+ if (StringHelper::check($accessTo))
+ {
+ return $this->user->authorise($accessTo, 'com_componentbuilder') && $dashboardList;
+ }
+
+ return !$accessTo && !$accessAdd;
+ }
+
+ /**
+ * Create a \stdClass icon object.
+ *
+ * @param string $url Icon URL.
+ * @param string $name Language string or label.
+ * @param string $image Image filename.
+ * @param string $alt Alt text.
+ *
+ * @return \stdClass
+ * @since 5.1.1
+ */
+ protected function createIconObject(string $url, string $name, string $image, string $alt): \stdClass
+ {
+ $icon = new \stdClass;
+ $icon->url = $url;
+ $icon->name = $name;
+ $icon->image = $image;
+ $icon->alt = $alt;
+ return $icon;
+ }
+
+
+ /**
+ * Load and display the wiki page content using an AJAX call to the component endpoint.
+ *
+ * This method injects an inline JavaScript script that asynchronously fetches the wiki page content
+ * via a JSON API endpoint in the component. It uses the `marked` library to render markdown content
+ * and inserts the result into the `wiki-md` container. Errors are displayed in a separate element.
+ *
+ * @return string HTML markup including a container for the wiki content and an error message area.
+ * @since 3.9.0
+ */
public function getWiki()
{
- // the call URL
+ // call the ajax get wiki endpoint
$call_url = Uri::base() . 'index.php?option=com_componentbuilder&task=ajax.getWiki&format=json&raw=true&' . Session::getFormToken() . '=1&name=Home';
- $document = Factory::getDocument();
- $document->addScriptDeclaration('
+
+ /** \Joomla\CMS\WebAsset\WebAssetManager $wa */
+ $wa = Factory::getApplication()->getDocument()->getWebAssetManager();
+ $wa->addInlineScript('
function getWikiPage(){
fetch("' . $call_url . '").then((response) => {
if (response.ok) {
@@ -528,13 +598,27 @@ class ComponentbuilderModel extends ListModel
}
+ /**
+ * Load and display the component's README file using JavaScript fetch and markdown rendering.
+ *
+ * This method injects an inline script into the document that, once the DOM is fully loaded,
+ * fetches the README.txt file located in the administrator component directory, parses it using
+ * the `marked` JavaScript library, and inserts the HTML into the `readme-md` div.
+ *
+ * @return string HTML markup including a container for the README content and a loading message.
+ * @since 3.9.0
+ */
public function getReadme()
{
- $document = Factory::getDocument();
- $document->addScriptDeclaration('
- var getreadme = "'. Uri::root() . 'administrator/components/com_componentbuilder/README.txt";
+ // get readme text path
+ $call_url = Uri::root() . 'administrator/components/com_componentbuilder/README.txt';
+
+ /** \Joomla\CMS\WebAsset\WebAssetManager $wa */
+ $wa = Factory::getApplication()->getDocument()->getWebAssetManager();
+
+ $wa->addInlineScript('
document.addEventListener("DOMContentLoaded", function () {
- fetch(getreadme)
+ fetch("'. $call_url . '")
.then(response => {
if (!response.ok) {
throw new Error("Network response was not ok");
@@ -554,31 +638,45 @@ class ComponentbuilderModel extends ListModel
}
/**
- * get Current Version Bay adding JavaScript to the Page
+ * Inject JavaScript that fetches and displays the current component version status.
*
- * @return void
- * @since 2.3.0
+ * This method adds an inline script to the page which asynchronously calls the component's
+ * AJAX endpoint to check the latest version. It updates the `#component-update-notice` element
+ * with the fetched version notice or error message.
+ *
+ * @return void
+ * @since 2.3.0
*/
public function getVersion()
{
- // the call URL
- $call_url = Uri::base() . 'index.php?option=com_componentbuilder&task=ajax.getVersion&format=json&raw=true&' . Session::getFormToken() . '=1&version=1';
- $document = Factory::getDocument();
- $document->addScriptDeclaration('
- function getComponentVersionStatus() {
- fetch("' . $call_url . '").then((response) => {
- if (response.ok) {
- return response.json();
- }
- }).then((result) => {
- if (typeof result.notice !== "undefined") {
- document.getElementById("component-update-notice").innerHTML = result.notice;
- } else if (typeof result.error !== "undefined") {
- document.getElementById("component-update-notice").innerHTML = result.error;
- }
- });
+ // call the ajax get version endpoint
+ $call_url = Uri::base()
+ . 'index.php?option=com_componentbuilder&task=ajax.getVersion&format=json&raw=true&'
+ . Session::getFormToken() . '=1&version=1.0.0';
+
+ try {
+ /** \Joomla\CMS\WebAsset\WebAssetManager $wa */
+ $wa = Factory::getApplication()->getDocument()->getWebAssetManager();
+
+ $wa->addInlineScript('
+ function getComponentVersionStatus() {
+ fetch("' . $call_url . '").then((response) => {
+ if (response.ok) {
+ return response.json();
+ }
+ }).then((result) => {
+ const target = document.getElementById("component-update-notice");
+ if (!target) return;
+ if (typeof result.notice !== "undefined") {
+ target.innerHTML = result.notice;
+ } else if (typeof result.error !== "undefined") {
+ target.innerHTML = result.error;
+ }
+ });
+ }
+ setTimeout(getComponentVersionStatus, 800);');
+ } catch (\Throwable $e) {
+ // we do nothing....
}
- setTimeout(getComponentVersionStatus, 800);');
- }
-
+ }
}
diff --git a/admin/src/Model/Custom_codesModel.php b/admin/src/Model/Custom_codesModel.php
index 80b0f9d38..bb91182a7 100644
--- a/admin/src/Model/Custom_codesModel.php
+++ b/admin/src/Model/Custom_codesModel.php
@@ -218,6 +218,7 @@ class Custom_codesModel extends ListModel
$item->target_code = $item->target;
// making sure we have the component details
+
}
}
diff --git a/admin/src/Model/FieldModel.php b/admin/src/Model/FieldModel.php
index 48afe8e64..013521948 100644
--- a/admin/src/Model/FieldModel.php
+++ b/admin/src/Model/FieldModel.php
@@ -1189,7 +1189,7 @@ class FieldModel extends AdminModel
}
break;
case 'type':
- $property['value'] = TypeHelper::safe($property['value']);
+ $property['value'] = TypeHelper::safe($property['value'], 'com_componentbuilder');
break;
}
// load the property
diff --git a/admin/src/Model/FieldtypeModel.php b/admin/src/Model/FieldtypeModel.php
index 84426e6f8..5ec4b3578 100644
--- a/admin/src/Model/FieldtypeModel.php
+++ b/admin/src/Model/FieldtypeModel.php
@@ -288,253 +288,10 @@ class FieldtypeModel extends AdminModel
$this->db->updateObject('#__componentbuilder_fieldtype', $objectUpdate, 'id');
}
}
- $this->fieldtypevvvv = $item->guid;
return $item;
}
- /**
- * Method to get list data.
- *
- * @return mixed An array of data items on success, false on failure.
- */
- public function getVxlfields()
- {
- // Get the user object.
- $user = Factory::getApplication()->getIdentity();
- // Create a new query object.
- $db = $this->getDatabase();
- $query = $db->getQuery(true);
-
- // Select some fields
- $query->select('a.*');
- $query->select($db->quoteName('c.title','category_title'));
-
- // From the componentbuilder_field table
- $query->from($db->quoteName('#__componentbuilder_field', 'a'));
- $query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
-
- // Filtering "extension"
- $filter_extension = $this->state->get("filter.extension");
- $field_guids = [];
- $get_ids = true;
- if ($get_ids && $filter_extension !== null && !empty($filter_extension))
- {
- // column name, and id
- $type_extension = explode('__', $filter_extension);
- if (($guids = JCBFilterHelper::linked((string) $type_extension[1], (string) $type_extension[0])) !== null)
- {
- $field_guids = $guids;
- }
- else
- {
- // there is none
- $query->where($db->quoteName('a.id') . ' = ' . 0);
- $get_ids = false;
- }
- }
-
- // Filtering "admin_view"
- $filter_admin_view = $this->state->get("filter.admin_view");
- if ($get_ids && $filter_admin_view !== null && !empty($filter_admin_view))
- {
- if (($guids = JCBFilterHelper::linked((string) $filter_admin_view, 'admin_view')) !== null)
- {
- // view will return less fields, so we ignore the component
- $field_guids = $guids;
- }
- else
- {
- // there is none
- $query->where($db->quoteName('a.id') . ' = ' . 0);
- $get_ids = false;
- }
- }
- // now check if we have GUIDs
- if ($get_ids && UtilitiesArrayHelper::check($field_guids))
- {
- $query->where($db->quoteName('a.guid') . ' IN ("' . implode('","', $field_guids) . '")');
- }
-
- // From the componentbuilder_fieldtype table.
- $query->select($db->quoteName(['g.name','g.id'],['fieldtype_name','fieldtype_id']));
- $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'g') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('g.guid') . ')');
-
- // Filter by fieldtypevvvv global.
- $fieldtypevvvv = $this->fieldtypevvvv;
- if (is_numeric($fieldtypevvvv ))
- {
- $query->where('a.fieldtype = ' . (int) $fieldtypevvvv );
- }
- elseif (is_string($fieldtypevvvv))
- {
- $query->where('a.fieldtype = ' . $db->quote($fieldtypevvvv));
- }
- else
- {
- $query->where('a.fieldtype = -5');
- }
-
- // Join over the asset groups.
- $query->select('ag.title AS access_level');
- $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
- // Filter by access level.
- $_access = $this->getState('filter.access');
- if ($_access && is_numeric($_access))
- {
- $query->where('a.access = ' . (int) $_access);
- }
- elseif (UtilitiesArrayHelper::check($_access))
- {
- // Secure the array for the query
- $_access = ArrayHelper::toInteger($_access);
- // Filter by the Access Array.
- $query->where('a.access IN (' . implode(',', $_access) . ')');
- }
- // Implement View Level Access
- if (!$user->authorise('core.options', 'com_componentbuilder'))
- {
- $groups = implode(',', $user->getAuthorisedViewLevels());
- $query->where('a.access IN (' . $groups . ')');
- }
-
- // Order the results by ordering
- $query->order('a.published ASC');
- $query->order('a.ordering ASC');
-
- // Load the items
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- $items = $db->loadObjectList();
-
- // Set values to display correctly.
- if (UtilitiesArrayHelper::check($items))
- {
- // Get the user object if not set.
- if (!isset($user) || !ObjectHelper::check($user))
- {
- $user = $this->getCurrentUser();
- }
- foreach ($items as $nr => &$item)
- {
- // Remove items the user can't access.
- $access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder'));
- if (!$access)
- {
- unset($items[$nr]);
- continue;
- }
-
- }
- }
-
- // set selection value to a translatable value
- if (UtilitiesArrayHelper::check($items))
- {
- foreach ($items as $nr => &$item)
- {
- // convert datatype
- $item->datatype = $this->selectionTranslationVxlfields($item->datatype, 'datatype');
- // convert indexes
- $item->indexes = $this->selectionTranslationVxlfields($item->indexes, 'indexes');
- // convert null_switch
- $item->null_switch = $this->selectionTranslationVxlfields($item->null_switch, 'null_switch');
- // convert store
- $item->store = $this->selectionTranslationVxlfields($item->store, 'store');
- }
- }
-
- return $items;
- }
- return false;
- }
-
- /**
- * Method to convert selection values to translatable string.
- *
- * @return string The translatable string.
- */
- public function selectionTranslationVxlfields($value,$name)
- {
- // Array of datatype language strings
- if ($name === 'datatype')
- {
- $datatypeArray = array(
- 0 => 'COM_COMPONENTBUILDER_FIELD_SELECT_AN_OPTION',
- 'CHAR' => 'COM_COMPONENTBUILDER_FIELD_CHAR',
- 'VARCHAR' => 'COM_COMPONENTBUILDER_FIELD_VARCHAR',
- 'TEXT' => 'COM_COMPONENTBUILDER_FIELD_TEXT',
- 'MEDIUMTEXT' => 'COM_COMPONENTBUILDER_FIELD_MEDIUMTEXT',
- 'LONGTEXT' => 'COM_COMPONENTBUILDER_FIELD_LONGTEXT',
- 'BLOB' => 'COM_COMPONENTBUILDER_FIELD_BLOB',
- 'TINYBLOB' => 'COM_COMPONENTBUILDER_FIELD_TINYBLOB',
- 'MEDIUMBLOB' => 'COM_COMPONENTBUILDER_FIELD_MEDIUMBLOB',
- 'LONGBLOB' => 'COM_COMPONENTBUILDER_FIELD_LONGBLOB',
- 'DATETIME' => 'COM_COMPONENTBUILDER_FIELD_DATETIME',
- 'DATE' => 'COM_COMPONENTBUILDER_FIELD_DATE',
- 'TIME' => 'COM_COMPONENTBUILDER_FIELD_TIME',
- 'INT' => 'COM_COMPONENTBUILDER_FIELD_INT',
- 'TINYINT' => 'COM_COMPONENTBUILDER_FIELD_TINYINT',
- 'BIGINT' => 'COM_COMPONENTBUILDER_FIELD_BIGINT',
- 'FLOAT' => 'COM_COMPONENTBUILDER_FIELD_FLOAT',
- 'DECIMAL' => 'COM_COMPONENTBUILDER_FIELD_DECIMAL',
- 'DOUBLE' => 'COM_COMPONENTBUILDER_FIELD_DOUBLE'
- );
- // Now check if value is found in this array
- if (isset($datatypeArray[$value]) && UtilitiesStringHelper::check($datatypeArray[$value]))
- {
- return $datatypeArray[$value];
- }
- }
- // Array of indexes language strings
- if ($name === 'indexes')
- {
- $indexesArray = array(
- 1 => 'COM_COMPONENTBUILDER_FIELD_UNIQUE_KEY',
- 2 => 'COM_COMPONENTBUILDER_FIELD_KEY',
- 0 => 'COM_COMPONENTBUILDER_FIELD_NONE'
- );
- // Now check if value is found in this array
- if (isset($indexesArray[$value]) && UtilitiesStringHelper::check($indexesArray[$value]))
- {
- return $indexesArray[$value];
- }
- }
- // Array of null_switch language strings
- if ($name === 'null_switch')
- {
- $null_switchArray = array(
- 'NULL' => 'COM_COMPONENTBUILDER_FIELD_NULL',
- 'NOT NULL' => 'COM_COMPONENTBUILDER_FIELD_NOT_NULL'
- );
- // Now check if value is found in this array
- if (isset($null_switchArray[$value]) && UtilitiesStringHelper::check($null_switchArray[$value]))
- {
- return $null_switchArray[$value];
- }
- }
- // Array of store language strings
- if ($name === 'store')
- {
- $storeArray = array(
- 0 => 'COM_COMPONENTBUILDER_FIELD_DEFAULT',
- 1 => 'COM_COMPONENTBUILDER_FIELD_JSON',
- 2 => 'COM_COMPONENTBUILDER_FIELD_BASE64',
- 3 => 'COM_COMPONENTBUILDER_FIELD_BASIC_ENCRYPTION_LOCALDBKEY',
- 5 => 'COM_COMPONENTBUILDER_FIELD_MEDIUM_ENCRYPTION_LOCALFILEKEY',
- 6 => 'COM_COMPONENTBUILDER_FIELD_EXPERT_MODE_CUSTOM'
- );
- // Now check if value is found in this array
- if (isset($storeArray[$value]) && UtilitiesStringHelper::check($storeArray[$value]))
- {
- return $storeArray[$value];
- }
- }
- return $value;
- }
-
/**
* Method to get the record form.
*
diff --git a/admin/src/Model/Get_snippetsModel.php b/admin/src/Model/Get_snippetsModel.php
deleted file mode 100644
index a45e46f99..000000000
--- a/admin/src/Model/Get_snippetsModel.php
+++ /dev/null
@@ -1,283 +0,0 @@
-
- * @git Joomla Component Builder
- * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- */
-namespace VDM\Component\Componentbuilder\Administrator\Model;
-
-use Joomla\CMS\Factory;
-use Joomla\CMS\Language\Text;
-use Joomla\CMS\Application\CMSApplicationInterface;
-use Joomla\CMS\Component\ComponentHelper;
-use Joomla\CMS\MVC\Model\ListModel;
-use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
-use Joomla\CMS\Plugin\PluginHelper;
-use Joomla\CMS\Router\Route;
-use Joomla\CMS\User\User;
-use Joomla\Utilities\ArrayHelper;
-use Joomla\Input\Input;
-use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
-
-// No direct access to this file
-\defined('_JEXEC') or die;
-
-/**
- * Componentbuilder List Model for Get_snippets
- *
- * @since 1.6
- */
-class Get_snippetsModel extends ListModel
-{
- /**
- * Represents the current user object.
- *
- * @var User The user object representing the current user.
- * @since 3.2.0
- */
- protected User $user;
-
- /**
- * The unique identifier of the current user.
- *
- * @var int|null The ID of the current user.
- * @since 3.2.0
- */
- protected ?int $userId;
-
- /**
- * Flag indicating whether the current user is a guest.
- *
- * @var int 1 if the user is a guest, 0 otherwise.
- * @since 3.2.0
- */
- protected int $guest;
-
- /**
- * An array of groups that the current user belongs to.
- *
- * @var array|null An array of user group IDs.
- * @since 3.2.0
- */
- protected ?array $groups;
-
- /**
- * An array of view access levels for the current user.
- *
- * @var array|null An array of access level IDs.
- * @since 3.2.0
- */
- protected ?array $levels;
-
- /**
- * The application object.
- *
- * @var CMSApplicationInterface The application instance.
- * @since 3.2.0
- */
- protected CMSApplicationInterface $app;
-
- /**
- * The input object, providing access to the request data.
- *
- * @var Input The input object.
- * @since 3.2.0
- */
- protected Input $input;
-
- /**
- * The styles array.
- *
- * @var array
- * @since 4.3
- */
- protected array $styles = [
- 'administrator/components/com_componentbuilder/assets/css/admin.css',
- 'administrator/components/com_componentbuilder/assets/css/get_snippets.css'
- ];
-
- /**
- * The scripts array.
- *
- * @var array
- * @since 4.3
- */
- protected array $scripts = [
- 'administrator/components/com_componentbuilder/assets/js/admin.js'
- ];
-
- /**
- * A custom property for UI Kit components.
- *
- * @var mixed Property for storing UI Kit component-related data or objects.
- * @since 3.2.0
- */
- protected $uikitComp = [];
-
- /**
- * Constructor
- *
- * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
- * @param ?MVCFactoryInterface $factory The factory.
- *
- * @since 1.6
- * @throws \Exception
- */
- public function __construct($config = [], MVCFactoryInterface $factory = null)
- {
- parent::__construct($config, $factory);
-
- $this->app ??= Factory::getApplication();
- $this->input ??= $this->app->getInput();
-
- // Set the current user for authorisation checks (for those calling this model directly)
- $this->user ??= $this->getCurrentUser();
- $this->userId = $this->user->get('id');
- $this->guest = $this->user->get('guest');
- $this->groups = $this->user->get('groups');
- $this->authorisedGroups = $this->user->getAuthorisedGroups();
- $this->levels = $this->user->getAuthorisedViewLevels();
-
- // will be removed
- $this->initSet = true;
- }
-
- /**
- * Method to build an SQL query to load the list data.
- *
- * @return string An SQL query
- * @since 1.6
- */
- protected function getListQuery()
- {
- // Make sure all records load, since no pagination allowed.
- $this->setState('list.limit', 0);
- // Get a db connection.
- $db = $this->getDatabase();
-
- // Create a new query object.
- $query = $db->getQuery(true);
-
- // Get from #__componentbuilder_snippet as a
- $query->select($db->quoteName(
- array('a.id','a.heading','a.name','a.url','a.created','a.modified'),
- array('id','heading','name','url','created','modified')));
- $query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
-
- // Get from #__componentbuilder_snippet_type as b
- $query->select($db->quoteName(
- array('b.name'),
- array('type')));
- $query->join('LEFT', ($db->quoteName('#__componentbuilder_snippet_type', 'b')) . ' ON (' . $db->quoteName('a.type') . ' = ' . $db->quoteName('b.id') . ')');
-
- // Get from #__componentbuilder_library as c
- $query->select($db->quoteName(
- array('c.name'),
- array('library')));
- $query->join('LEFT', ($db->quoteName('#__componentbuilder_library', 'c')) . ' ON (' . $db->quoteName('a.library') . ' = ' . $db->quoteName('c.id') . ')');
-
- // return the query object
- return $query;
- }
-
- /**
- * Method to get an array of data items.
- *
- * @return mixed An array of data items on success, false on failure.
- * @since 1.6
- */
- public function getItems()
- {
- $user = $this->user;
- // check if this user has permission to access items
- if (!$user->authorise('get_snippets.access', 'com_componentbuilder'))
- {
- $this->app->enqueueMessage(Text::_('Not authorised!'), 'error');
- // redirect away if not a correct to default view
- $this->app->redirect('index.php?option=com_componentbuilder');
- return false;
- }
- // load parent items
- $items = parent::getItems();
-
- // Get the global params
- $globalParams = ComponentHelper::getParams('com_componentbuilder', true);
-
- // Insure all item fields are adapted where needed.
- if (UtilitiesArrayHelper::check($items))
- {
- foreach ($items as $nr => &$item)
- {
- // Always create a slug for sef URL's
- $item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
- }
- }
-
- // return items
- return $items;
- }
-
- /**
- * Method to get the styles that have to be included on the view
- *
- * @return array styles files
- * @since 4.3
- */
- public function getStyles(): array
- {
- return $this->styles;
- }
-
- /**
- * Method to set the styles that have to be included on the view
- *
- * @return void
- * @since 4.3
- */
- public function setStyles(string $path): void
- {
- $this->styles[] = $path;
- }
-
- /**
- * Method to get the script that have to be included on the view
- *
- * @return array script files
- * @since 4.3
- */
- public function getScripts(): array
- {
- return $this->scripts;
- }
-
- /**
- * Method to set the script that have to be included on the view
- *
- * @return void
- * @since 4.3
- */
- public function setScript(string $path): void
- {
- $this->scripts[] = $path;
- }
-
- /**
- * Get the uikit needed components
- *
- * @return mixed An array of objects on success.
- *
- */
- public function getUikitComp()
- {
- if (isset($this->uikitComp) && UtilitiesArrayHelper::check($this->uikitComp))
- {
- return $this->uikitComp;
- }
- return false;
- }
-}
diff --git a/admin/src/Model/Import_joomla_componentsimportModel.php b/admin/src/Model/Import_joomla_componentsimportModel.php
index a6c9da123..8727c7247 100644
--- a/admin/src/Model/Import_joomla_componentsimportModel.php
+++ b/admin/src/Model/Import_joomla_componentsimportModel.php
@@ -13,7 +13,7 @@ namespace VDM\Component\Componentbuilder\Administrator\Model;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\File;
-use Joomla\CMS\Filesystem\Folder;
+use Joomla\Filesystem\Folder;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\Installer\InstallerHelper;
@@ -22,14 +22,8 @@ use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
-use VDM\Joomla\Utilities\ObjectHelper;
-use VDM\Joomla\Utilities\JsonHelper;
-use VDM\Joomla\Utilities\FileHelper;
-use VDM\Joomla\Utilities\GetHelper;
-use VDM\Joomla\Utilities\GuidHelper;
-use Joomla\CMS\Component\ComponentHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
+use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use Joomla\Filesystem\File as FilesystemFile;
diff --git a/admin/src/Model/Import_language_translationsimportModel.php b/admin/src/Model/Import_language_translationsimportModel.php
index 350ed2503..673d1f581 100644
--- a/admin/src/Model/Import_language_translationsimportModel.php
+++ b/admin/src/Model/Import_language_translationsimportModel.php
@@ -13,7 +13,7 @@ namespace VDM\Component\Componentbuilder\Administrator\Model;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\File;
-use Joomla\CMS\Filesystem\Folder;
+use Joomla\Filesystem\Folder;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\Installer\InstallerHelper;
diff --git a/admin/src/Model/Initialization_selectionModel.php b/admin/src/Model/Initialization_selectionModel.php
new file mode 100644
index 000000000..7a0ee45fb
--- /dev/null
+++ b/admin/src/Model/Initialization_selectionModel.php
@@ -0,0 +1,418 @@
+
+ * @git Joomla Component Builder
+ * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+namespace VDM\Component\Componentbuilder\Administrator\Model;
+
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Application\CMSApplicationInterface;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\MVC\Model\ItemModel;
+use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
+use Joomla\CMS\Plugin\PluginHelper;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Uri\Uri;
+use Joomla\CMS\User\User;
+use Joomla\Input\Input;
+use Joomla\Utilities\ArrayHelper;
+use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use Joomla\CMS\Helper\TagsHelper;
+use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
+use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
+use VDM\Joomla\Componentbuilder\Fieldtype\Factory as FieldtypeFactory;
+use VDM\Joomla\Componentbuilder\JoomlaPower\Factory as JoomlaPowerFactory;
+use VDM\Joomla\Componentbuilder\Power\Factory as PowerFactory;
+use VDM\Joomla\Componentbuilder\Snippet\Factory as SnippetFactory;
+use VDM\Joomla\Componentbuilder\Repository\Factory as RepositoryFactory;
+
+// No direct access to this file
+\defined('_JEXEC') or die;
+
+/**
+ * Componentbuilder Initialization_selection Item Model
+ *
+ * @since 1.6
+ */
+class Initialization_selectionModel extends ItemModel
+{
+ /**
+ * Model context string.
+ *
+ * @var string
+ * @since 1.6
+ */
+ protected $_context = 'com_componentbuilder.initialization_selection';
+
+ /**
+ * Represents the current user object.
+ *
+ * @var User The user object representing the current user.
+ * @since 3.2.0
+ */
+ protected User $user;
+
+ /**
+ * The unique identifier of the current user.
+ *
+ * @var int|null The ID of the current user.
+ * @since 3.2.0
+ */
+ protected ?int $userId;
+
+ /**
+ * Flag indicating whether the current user is a guest.
+ *
+ * @var int 1 if the user is a guest, 0 otherwise.
+ * @since 3.2.0
+ */
+ protected int $guest;
+
+ /**
+ * An array of groups that the current user belongs to.
+ *
+ * @var array|null An array of user group IDs.
+ * @since 3.2.0
+ */
+ protected ?array $groups;
+
+ /**
+ * An array of view access levels for the current user.
+ *
+ * @var array|null An array of access level IDs.
+ * @since 3.2.0
+ */
+ protected ?array $levels;
+
+ /**
+ * The application object.
+ *
+ * @var CMSApplicationInterface The application instance.
+ * @since 3.2.0
+ */
+ protected CMSApplicationInterface $app;
+
+ /**
+ * The input object, providing access to the request data.
+ *
+ * @var Input The input object.
+ * @since 3.2.0
+ */
+ protected Input $input;
+
+ /**
+ * The styles array.
+ *
+ * @var array
+ * @since 4.3
+ */
+ protected array $styles = [
+ 'administrator/components/com_componentbuilder/assets/css/admin.css',
+ 'administrator/components/com_componentbuilder/assets/css/initialization_selection.css'
+ ];
+
+ /**
+ * The scripts array.
+ *
+ * @var array
+ * @since 4.3
+ */
+ protected array $scripts = [
+ 'administrator/components/com_componentbuilder/assets/js/admin.js'
+ ];
+
+ /**
+ * A custom property for UI Kit components.
+ *
+ * @var mixed Property for storing UI Kit component-related data or objects.
+ * @since 3.2.0
+ */
+ protected $uikitComp = [];
+
+ /**
+ * @var object item
+ * @since 1.6
+ */
+ protected $item;
+
+ /**
+ * Constructor
+ *
+ * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
+ * @param ?MVCFactoryInterface $factory The factory.
+ *
+ * @since 3.0
+ * @throws \Exception
+ */
+ public function __construct($config = [], MVCFactoryInterface $factory = null)
+ {
+ parent::__construct($config, $factory);
+
+ $this->app ??= Factory::getApplication();
+ $this->input ??= $this->app->getInput();
+
+ // Set the current user for authorisation checks (for those calling this model directly)
+ $this->user ??= $this->getCurrentUser();
+ $this->userId = $this->user->get('id');
+ $this->guest = $this->user->get('guest');
+ $this->groups = $this->user->get('groups');
+ $this->authorisedGroups = $this->user->getAuthorisedGroups();
+ $this->levels = $this->user->getAuthorisedViewLevels();
+
+ // will be removed
+ $this->initSet = true;
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * Note. Calling getState in this method will result in recursion.
+ *
+ * @return void
+ * @since 1.6
+ */
+ protected function populateState()
+ {
+ // Get the item main id
+ $id = $this->input->getInt('id', null);
+ $this->setState('initialization_selection.id', $id);
+
+ // Load the parameters.
+ parent::populateState();
+ }
+
+ /**
+ * Method to get article data.
+ *
+ * @param integer $pk The id of the article.
+ *
+ * @return mixed Menu item data object on success, false on failure.
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ // check if this user has permission to access item
+ if (!$this->user->authorise('initialization_selection.access', 'com_componentbuilder'))
+ {
+ $this->app->enqueueMessage(Text::_('Not authorised!'), 'error');
+ // redirect away if not a correct to cPanel/default view
+ $this->app->redirect('index.php?option=com_componentbuilder');
+ return false;
+ }
+
+ $pk = (!empty($pk)) ? $pk : (int) $this->getState('initialization_selection.id');
+
+ if ($this->_item === null)
+ {
+ $this->_item = [];
+ }
+
+ if (!isset($this->_item[$pk]))
+ {
+ try
+ {
+ // Get a db connection.
+ $db = $this->getDatabase();
+
+ // Create a new query object.
+ $query = $db->getQuery(true);
+
+ // Get data
+ $data = $this->getPaths();
+
+ if (empty($data))
+ {
+ $app = Factory::getApplication();
+ // If no data is found redirect to default page and show warning.
+ $app->enqueueMessage(Text::_('COM_COMPONENTBUILDER_NOT_FOUND_OR_ACCESS_DENIED'), 'warning');
+ $app->redirect('index.php?option=com_componentbuilder');
+ return false;
+ }
+
+ // set data object to item.
+ $this->_item[$pk] = $data;
+ }
+ catch (\Exception $e)
+ {
+ if ($e->getCode() == 404)
+ {
+ // Need to go thru the error handler to allow Redirect to work.
+ throw $e;
+ }
+ else
+ {
+ $this->setError($e);
+ $this->_item[$pk] = false;
+ }
+ }
+ }
+
+ return $this->_item[$pk];
+ }
+
+ /**
+ * Method to get the styles that have to be included on the view
+ *
+ * @return array styles files
+ * @since 4.3
+ */
+ public function getStyles(): array
+ {
+ return $this->styles;
+ }
+
+ /**
+ * Method to set the styles that have to be included on the view
+ *
+ * @return void
+ * @since 4.3
+ */
+ public function setStyles(string $path): void
+ {
+ $this->styles[] = $path;
+ }
+
+ /**
+ * Method to get the script that have to be included on the view
+ *
+ * @return array script files
+ * @since 4.3
+ */
+ public function getScripts(): array
+ {
+ return $this->scripts;
+ }
+
+ /**
+ * Method to set the script that have to be included on the view
+ *
+ * @return void
+ * @since 4.3
+ */
+ public function setScript(string $path): void
+ {
+ $this->scripts[] = $path;
+ }
+
+ /**
+ * Get the uikit needed components
+ *
+ * @return mixed An array of objects on success.
+ *
+ */
+ public function getUikitComp()
+ {
+ if (isset($this->uikitComp) && UtilitiesArrayHelper::check($this->uikitComp))
+ {
+ return $this->uikitComp;
+ }
+ return false;
+ }
+
+ /**
+ * Method to get the target power
+ *
+ * @return array|null
+ *
+ * @since 5.1.1
+ */
+ protected function getTargetAreaPower(): ?array
+ {
+ $power = $this->input->getString('power', null) ?? 'error';
+ return $this->powers[$power] ? ['class' => $this->powers[$power], 'area' => $power] : null;
+ }
+
+ /**
+ * Method to get the paths (repos) of this area.
+ *
+ * @return array|null
+ * @throws \Exception
+ * @since 5.1.1
+ */
+ protected function getPaths(): ?array
+ {
+ if (($Power = $this->getTargetAreaPower()) !== null)
+ {
+ try
+ {
+ $class = $this->getPowerClass($Power['class'], "{$Power['area']}.Remote.Get");
+ if ($class === null)
+ {
+ return null;
+ }
+ return ['repos' => $class->paths(), 'area_class' => $Power['area'], 'headers' => $class->getIndexHeader(), 'area_name' => $class->getArea()];
+ }
+ catch (\Exception $e)
+ {
+ if ($e->getCode() == 404)
+ {
+ // Need to go thru the error handler to allow Redirect to work.
+ throw $e;
+ }
+ else
+ {
+ $this->setError($e);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * The powers that we can initialize
+ *
+ * @var array
+ * @since 5.1.1
+ */
+ protected array $powers = [
+ 'AdminView' => 'PackageFactory',
+ 'Component' => 'PackageFactory',
+ 'CustomAdminView' => 'PackageFactory',
+ 'CustomCode' => 'PackageFactory',
+ 'DynamicGet' => 'PackageFactory',
+ 'Field' => 'PackageFactory',
+ 'Joomla.Fieldtype' => 'FieldtypeFactory',
+ 'Joomla.Power' => 'JoomlaPowerFactory',
+ 'Layout' => 'PackageFactory',
+ 'Library' => 'PackageFactory',
+ 'JoomlaModule' => 'PackageFactory',
+ 'JoomlaPlugin' => 'PackageFactory',
+ 'Power' => 'PowerFactory',
+ 'SiteView' => 'PackageFactory',
+ 'Snippet' => 'SnippetFactory',
+ 'Template' => 'PackageFactory',
+ 'ClassExtends' => 'PackageFactory',
+ 'ClassProperty' => 'PackageFactory',
+ 'ClassMethod' => 'PackageFactory',
+ 'Placeholder' => 'PackageFactory',
+ 'Repository' => 'RepositoryFactory'
+ ];
+
+ /**
+ * Method to get the power get class
+ *
+ * @param string $factoryName The factory name
+ * @param string $getClass The remote power class name
+ *
+ * @return mixed
+ * @since 5.1.1
+ */
+ protected function getPowerClass(string $factoryName, string $getClass)
+ {
+ return match ($factoryName) {
+ 'PowerFactory' => PowerFactory::_($getClass),
+ 'JoomlaPowerFactory' => JoomlaPowerFactory::_($getClass),
+ 'FieldtypeFactory' => FieldtypeFactory::_($getClass),
+ 'SnippetFactory' => SnippetFactory::_($getClass),
+ 'PackageFactory' => PackageFactory::_($getClass),
+ 'RepositoryFactory' => RepositoryFactory::_($getClass),
+ default => null,
+ };
+ }
+}
diff --git a/admin/src/Model/Joomla_componentModel.php b/admin/src/Model/Joomla_componentModel.php
index 335407a97..0ac277022 100644
--- a/admin/src/Model/Joomla_componentModel.php
+++ b/admin/src/Model/Joomla_componentModel.php
@@ -93,6 +93,37 @@ class Joomla_componentModel extends AdminModel
'not_required'
)
),
+ 'libs_helpers' => array(
+ 'fullwidth' => array(
+ 'creatuserhelper',
+ 'adduikit',
+ 'addfootable',
+ 'add_email_helper',
+ 'add_php_helper_both',
+ 'php_helper_both',
+ 'add_php_helper_admin',
+ 'php_helper_admin',
+ 'add_admin_event',
+ 'php_admin_event',
+ 'add_php_helper_site',
+ 'php_helper_site',
+ 'add_site_event',
+ 'php_site_event',
+ 'add_javascript',
+ 'javascript',
+ 'add_css_admin',
+ 'css_admin',
+ 'add_css_site',
+ 'css_site'
+ )
+ ),
+ 'dynamic_build' => array(
+ 'fullwidth' => array(
+ 'note_buildcomp_dynamic_mysql',
+ 'buildcomp',
+ 'buildcompsql'
+ )
+ ),
'dynamic_integration' => array(
'left' => array(
'add_update_server',
@@ -122,13 +153,13 @@ class Joomla_componentModel extends AdminModel
'crowdin_account_api_key'
)
),
- 'mysql' => array(
- 'fullwidth' => array(
- 'add_sql',
- 'sql',
- 'add_sql_uninstall',
- 'sql_uninstall',
- 'assets_table_fix'
+ 'readme' => array(
+ 'left' => array(
+ 'addreadme',
+ 'readme'
+ ),
+ 'right' => array(
+ 'note_readme'
)
),
'dash_install' => array(
@@ -155,44 +186,13 @@ class Joomla_componentModel extends AdminModel
'php_method_install'
)
),
- 'libs_helpers' => array(
+ 'mysql' => array(
'fullwidth' => array(
- 'creatuserhelper',
- 'adduikit',
- 'addfootable',
- 'add_email_helper',
- 'add_php_helper_both',
- 'php_helper_both',
- 'add_php_helper_admin',
- 'php_helper_admin',
- 'add_admin_event',
- 'php_admin_event',
- 'add_php_helper_site',
- 'php_helper_site',
- 'add_site_event',
- 'php_site_event',
- 'add_javascript',
- 'javascript',
- 'add_css_admin',
- 'css_admin',
- 'add_css_site',
- 'css_site'
- )
- ),
- 'readme' => array(
- 'left' => array(
- 'addreadme',
- 'readme'
- ),
- 'right' => array(
- 'note_readme'
- )
- ),
- 'dynamic_build' => array(
- 'fullwidth' => array(
- 'note_buildcomp_dynamic_mysql',
- 'buildcomp',
- 'buildcompsql'
+ 'add_sql',
+ 'sql',
+ 'add_sql_uninstall',
+ 'sql_uninstall',
+ 'assets_table_fix'
)
),
'settings' => array(
@@ -216,14 +216,9 @@ class Joomla_componentModel extends AdminModel
'spacer_hr_6',
'to_ignore_note',
'toignore',
- 'spacer_hr_7',
- 'jcb_export_package_note',
- 'export_key',
- 'joomla_source_link',
- 'export_buy_link'
+ 'spacer_hr_7'
),
'fullwidth' => array(
- 'spacer_hr_8',
'note_on_contributors',
'addcontributors',
'emptycontributors',
@@ -388,16 +383,10 @@ class Joomla_componentModel extends AdminModel
$item->metadata = $registry->toArray();
}
- if (!empty($item->sql_uninstall))
+ if (!empty($item->javascript))
{
- // base64 Decode sql_uninstall.
- $item->sql_uninstall = base64_decode($item->sql_uninstall);
- }
-
- if (!empty($item->php_postflight_update))
- {
- // base64 Decode php_postflight_update.
- $item->php_postflight_update = base64_decode($item->php_postflight_update);
+ // base64 Decode javascript.
+ $item->javascript = base64_decode($item->javascript);
}
if (!empty($item->css_site))
@@ -412,22 +401,16 @@ class Joomla_componentModel extends AdminModel
$item->php_helper_site = base64_decode($item->php_helper_site);
}
- if (!empty($item->javascript))
+ if (!empty($item->php_preflight_update))
{
- // base64 Decode javascript.
- $item->javascript = base64_decode($item->javascript);
+ // base64 Decode php_preflight_update.
+ $item->php_preflight_update = base64_decode($item->php_preflight_update);
}
- if (!empty($item->php_method_install))
+ if (!empty($item->sql_uninstall))
{
- // base64 Decode php_method_install.
- $item->php_method_install = base64_decode($item->php_method_install);
- }
-
- if (!empty($item->php_admin_event))
- {
- // base64 Decode php_admin_event.
- $item->php_admin_event = base64_decode($item->php_admin_event);
+ // base64 Decode sql_uninstall.
+ $item->sql_uninstall = base64_decode($item->sql_uninstall);
}
if (!empty($item->php_site_event))
@@ -442,10 +425,10 @@ class Joomla_componentModel extends AdminModel
$item->css_admin = base64_decode($item->css_admin);
}
- if (!empty($item->php_preflight_update))
+ if (!empty($item->php_postflight_update))
{
- // base64 Decode php_preflight_update.
- $item->php_preflight_update = base64_decode($item->php_preflight_update);
+ // base64 Decode php_postflight_update.
+ $item->php_postflight_update = base64_decode($item->php_postflight_update);
}
if (!empty($item->php_preflight_install))
@@ -454,6 +437,12 @@ class Joomla_componentModel extends AdminModel
$item->php_preflight_install = base64_decode($item->php_preflight_install);
}
+ if (!empty($item->php_method_install))
+ {
+ // base64 Decode php_method_install.
+ $item->php_method_install = base64_decode($item->php_method_install);
+ }
+
if (!empty($item->php_postflight_install))
{
// base64 Decode php_postflight_install.
@@ -496,6 +485,12 @@ class Joomla_componentModel extends AdminModel
$item->php_helper_admin = base64_decode($item->php_helper_admin);
}
+ if (!empty($item->php_admin_event))
+ {
+ // base64 Decode php_admin_event.
+ $item->php_admin_event = base64_decode($item->php_admin_event);
+ }
+
// Get the basic encryption.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encryption object.
@@ -507,12 +502,6 @@ class Joomla_componentModel extends AdminModel
$item->crowdin_username = rtrim($basic->decryptString($item->crowdin_username), "\0");
}
- if (!empty($item->export_key) && $basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true)))
- {
- // basic decrypt data export_key.
- $item->export_key = rtrim($basic->decryptString($item->export_key), "\0");
- }
-
if (!empty($item->crowdin_project_api_key) && $basickey && !is_numeric($item->crowdin_project_api_key) && $item->crowdin_project_api_key === base64_encode(base64_decode($item->crowdin_project_api_key, true)))
{
// basic decrypt data crowdin_project_api_key.
@@ -1507,16 +1496,10 @@ class Joomla_componentModel extends AdminModel
$data['addcontributors'] = '';
}
- // Set the sql_uninstall string to base64 string.
- if (isset($data['sql_uninstall']))
+ // Set the javascript string to base64 string.
+ if (isset($data['javascript']))
{
- $data['sql_uninstall'] = base64_encode($data['sql_uninstall']);
- }
-
- // Set the php_postflight_update string to base64 string.
- if (isset($data['php_postflight_update']))
- {
- $data['php_postflight_update'] = base64_encode($data['php_postflight_update']);
+ $data['javascript'] = base64_encode($data['javascript']);
}
// Set the css_site string to base64 string.
@@ -1531,22 +1514,16 @@ class Joomla_componentModel extends AdminModel
$data['php_helper_site'] = base64_encode($data['php_helper_site']);
}
- // Set the javascript string to base64 string.
- if (isset($data['javascript']))
+ // Set the php_preflight_update string to base64 string.
+ if (isset($data['php_preflight_update']))
{
- $data['javascript'] = base64_encode($data['javascript']);
+ $data['php_preflight_update'] = base64_encode($data['php_preflight_update']);
}
- // Set the php_method_install string to base64 string.
- if (isset($data['php_method_install']))
+ // Set the sql_uninstall string to base64 string.
+ if (isset($data['sql_uninstall']))
{
- $data['php_method_install'] = base64_encode($data['php_method_install']);
- }
-
- // Set the php_admin_event string to base64 string.
- if (isset($data['php_admin_event']))
- {
- $data['php_admin_event'] = base64_encode($data['php_admin_event']);
+ $data['sql_uninstall'] = base64_encode($data['sql_uninstall']);
}
// Set the php_site_event string to base64 string.
@@ -1561,10 +1538,10 @@ class Joomla_componentModel extends AdminModel
$data['css_admin'] = base64_encode($data['css_admin']);
}
- // Set the php_preflight_update string to base64 string.
- if (isset($data['php_preflight_update']))
+ // Set the php_postflight_update string to base64 string.
+ if (isset($data['php_postflight_update']))
{
- $data['php_preflight_update'] = base64_encode($data['php_preflight_update']);
+ $data['php_postflight_update'] = base64_encode($data['php_postflight_update']);
}
// Set the php_preflight_install string to base64 string.
@@ -1573,6 +1550,12 @@ class Joomla_componentModel extends AdminModel
$data['php_preflight_install'] = base64_encode($data['php_preflight_install']);
}
+ // Set the php_method_install string to base64 string.
+ if (isset($data['php_method_install']))
+ {
+ $data['php_method_install'] = base64_encode($data['php_method_install']);
+ }
+
// Set the php_postflight_install string to base64 string.
if (isset($data['php_postflight_install']))
{
@@ -1615,6 +1598,12 @@ class Joomla_componentModel extends AdminModel
$data['php_helper_admin'] = base64_encode($data['php_helper_admin']);
}
+ // Set the php_admin_event string to base64 string.
+ if (isset($data['php_admin_event']))
+ {
+ $data['php_admin_event'] = base64_encode($data['php_admin_event']);
+ }
+
// Get the basic encryption key.
$basickey = ComponentbuilderHelper::getCryptKey('basic');
// Get the encryption object
@@ -1626,12 +1615,6 @@ class Joomla_componentModel extends AdminModel
$data['crowdin_username'] = $basic->encryptString($data['crowdin_username']);
}
- // Encrypt data export_key.
- if (isset($data['export_key']) && $basickey)
- {
- $data['export_key'] = $basic->encryptString($data['export_key']);
- }
-
// Encrypt data crowdin_project_api_key.
if (isset($data['crowdin_project_api_key']) && $basickey)
{
diff --git a/admin/src/Model/Joomla_componentsModel.php b/admin/src/Model/Joomla_componentsModel.php
index 0ae21aaeb..06f678f2a 100644
--- a/admin/src/Model/Joomla_componentsModel.php
+++ b/admin/src/Model/Joomla_componentsModel.php
@@ -23,7 +23,6 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\Input\Input;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use Joomla\CMS\Helper\TagsHelper;
-use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory;
use VDM\Joomla\Utilities\FileHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\GetHelper;
@@ -485,28 +484,26 @@ class Joomla_componentsModel extends ListModel
continue;
}
- // decode sql_uninstall
- $item->sql_uninstall = base64_decode($item->sql_uninstall);
- // decode php_postflight_update
- $item->php_postflight_update = base64_decode($item->php_postflight_update);
+ // decode javascript
+ $item->javascript = base64_decode($item->javascript);
// decode css_site
$item->css_site = base64_decode($item->css_site);
// decode php_helper_site
$item->php_helper_site = base64_decode($item->php_helper_site);
- // decode javascript
- $item->javascript = base64_decode($item->javascript);
- // decode php_method_install
- $item->php_method_install = base64_decode($item->php_method_install);
- // decode php_admin_event
- $item->php_admin_event = base64_decode($item->php_admin_event);
+ // decode php_preflight_update
+ $item->php_preflight_update = base64_decode($item->php_preflight_update);
+ // decode sql_uninstall
+ $item->sql_uninstall = base64_decode($item->sql_uninstall);
// decode php_site_event
$item->php_site_event = base64_decode($item->php_site_event);
// decode css_admin
$item->css_admin = base64_decode($item->css_admin);
- // decode php_preflight_update
- $item->php_preflight_update = base64_decode($item->php_preflight_update);
+ // decode php_postflight_update
+ $item->php_postflight_update = base64_decode($item->php_postflight_update);
// decode php_preflight_install
$item->php_preflight_install = base64_decode($item->php_preflight_install);
+ // decode php_method_install
+ $item->php_method_install = base64_decode($item->php_method_install);
// decode php_postflight_install
$item->php_postflight_install = base64_decode($item->php_postflight_install);
// decode php_method_uninstall
@@ -520,27 +517,24 @@ class Joomla_componentsModel extends ListModel
}
// decode buildcompsql
$item->buildcompsql = base64_decode($item->buildcompsql);
- if ($basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true)))
- {
- // decrypt export_key
- $item->export_key = $basic->decryptString($item->export_key);
- }
// decode readme
$item->readme = base64_decode($item->readme);
+ // decode php_helper_both
+ $item->php_helper_both = base64_decode($item->php_helper_both);
if ($basickey && !is_numeric($item->crowdin_project_api_key) && $item->crowdin_project_api_key === base64_encode(base64_decode($item->crowdin_project_api_key, true)))
{
// decrypt crowdin_project_api_key
$item->crowdin_project_api_key = $basic->decryptString($item->crowdin_project_api_key);
}
- // decode php_helper_both
- $item->php_helper_both = base64_decode($item->php_helper_both);
+ // decode php_helper_admin
+ $item->php_helper_admin = base64_decode($item->php_helper_admin);
if ($basickey && !is_numeric($item->crowdin_account_api_key) && $item->crowdin_account_api_key === base64_encode(base64_decode($item->crowdin_account_api_key, true)))
{
// decrypt crowdin_account_api_key
$item->crowdin_account_api_key = $basic->decryptString($item->crowdin_account_api_key);
}
- // decode php_helper_admin
- $item->php_helper_admin = base64_decode($item->php_helper_admin);
+ // decode php_admin_event
+ $item->php_admin_event = base64_decode($item->php_admin_event);
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
diff --git a/admin/src/Model/Joomla_pluginsModel.php b/admin/src/Model/Joomla_pluginsModel.php
index 0ff443d45..973a6dc3e 100644
--- a/admin/src/Model/Joomla_pluginsModel.php
+++ b/admin/src/Model/Joomla_pluginsModel.php
@@ -24,9 +24,8 @@ use Joomla\Input\Input;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
-use VDM\Joomla\Utilities\StringHelper;
-use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\ObjectHelper;
+use VDM\Joomla\Utilities\StringHelper;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -98,175 +97,6 @@ class Joomla_pluginsModel extends ListModel
$this->app ??= Factory::getApplication();
}
-
- /**
- * get Boilerplate
- *
- * @return boolean
- */
- public function getBoilerplate()
- {
- // get boilerplate repo root details
- if (($repo_tree = ComponentbuilderHelper::getGithubRepoFileList('boilerplate', ComponentbuilderHelper::$bolerplateAPI)) !== false)
- {
- $found = array_values(array_filter(
- $repo_tree,
- function($tree) {
- if (isset($tree->path) && $tree->path === 'plugins')
- {
- return true;
- }
- return false;
- }
- ));
- // make sure we have the correct boilerplate
- if (UtilitiesArrayHelper::check($found) && count($found) == 1 && method_exists(__CLASS__, 'getPluginsBoilerplate'))
- {
- // get the plugins boilerplate
- return $this->getPluginsBoilerplate($found[0]->url);
- }
- }
- return false;
- }
-
- /**
- * get Plugin Boilerplate
- *
- * @return boolean true on success
- *
- */
- protected function getPluginsBoilerplate($url)
- {
- // get boilerplate root for plugins
- if (($plugin_tree = ComponentbuilderHelper::getGithubRepoFileList('boilerplate_plugins', $url)) !== false)
- {
- // get the app object
- $app = Factory::getApplication();
- // set the table names
- $tables = array();
- $tables['e'] = 'class_extends';
- $tables['g'] = 'joomla_plugin_group';
- $tables['m'] = 'class_method';
- $tables['p'] = 'class_property';
- // load the needed models
- $models = array();
- $models['e'] = ComponentbuilderHelper::getModel($tables['e']);
- $models['g'] = ComponentbuilderHelper::getModel($tables['g']);
- $models['p'] = ComponentbuilderHelper::getModel($tables['p']);
- $models['m'] = ComponentbuilderHelper::getModel($tables['m']);
- // get the needed data of each plugin group
- $groups = array_map(
- function($tree) use(&$app, &$models, &$tables){
- if (($fooClass = ComponentbuilderHelper::getFileContents(ComponentbuilderHelper::$bolerplatePath . '/plugins/' . $tree->path . '/foo.php')) !== false && StringHelper::check($fooClass))
- {
- // extract the boilerplate class extends and check if already set
- if (($classExtends = ComponentbuilderHelper::extractBoilerplateClassExtends($fooClass, 'plugins')) !== false &&
- ($classExtendsID = GetHelper::var('class_extends', $classExtends, 'name', 'id')) === false)
- {
- // load the extends class name
- $class = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $classExtends);
- // extract the boilerplate class header
- $class['head'] = ComponentbuilderHelper::extractBoilerplateClassHeader($fooClass, $classExtends, 'plugins');
- // extract the boilerplate class comment
- $class['comment'] = ComponentbuilderHelper::extractBoilerplateClassComment($fooClass, $classExtends, 'plugins');
- // set the extension type
- $class['extension_type'] = 'plugins';
- // store the class
- $this->storePluginBoilerplate($tables['e'], $models['e'], $class, $app);
- // work around
- $classExtendsID = GetHelper::var('class_extends', $classExtends, 'name', 'id');
- }
- // set plugin group if not already set
- if (($pluginGroupID = GetHelper::var('joomla_plugin_group', $tree->path, 'name', 'id')) === false)
- {
- // load the plugin group name
- $pluginGroup = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $tree->path, 'class_extends' => $classExtendsID);
- // store the group
- $this->storePluginBoilerplate($tables['g'], $models['g'], $pluginGroup, $app);
- // work around
- $pluginGroupID = GetHelper::var('joomla_plugin_group', $tree->path, 'name', 'id');
- }
- // extract the boilerplate class property and methods
- if (($classProperiesMethods = ComponentbuilderHelper::extractBoilerplateClassPropertiesMethods($fooClass, $classExtends, 'plugins', $pluginGroupID)) !== false)
- {
- // create the properties found
- if (isset($classProperiesMethods['property']) && UtilitiesArrayHelper::check($classProperiesMethods['property']))
- {
- foreach ($classProperiesMethods['property'] as $_property)
- {
- // force update by default
- $this->storePluginBoilerplate($tables['p'], $models['p'], $_property, $app);
- }
- }
- // create the method found (TODO just create for now but we could later add a force update)
- if (isset($classProperiesMethods['method']) && UtilitiesArrayHelper::check($classProperiesMethods['method']))
- {
- foreach ($classProperiesMethods['method'] as $_method)
- {
- // force update by default
- $this->storePluginBoilerplate($tables['m'], $models['m'], $_method, $app);
- }
- }
- }
- }
- },
- $plugin_tree
- );
- }
- }
-
- /**
- * store Plugin Boilerplate
- *
- * @return boolean true on success
- *
- */
- protected function storePluginBoilerplate(&$table, &$method, &$boilerplate, &$app)
- {
- // Sometimes the form needs some posted data, such as for plugins and modules.
- $form = $method->getForm($boilerplate, false);
- if (!$form)
- {
- $app->enqueueMessage($method->getError(), 'error');
- return false;
- }
- // Send an object which can be modified through the plugin event
- $objData = (object) $boilerplate;
- $app->triggerEvent(
- 'onContentNormaliseRequestData',
- array('com_componentbuilder.' . $table, $objData, $form)
- );
- $boilerplate = (array) $objData;
- // Test whether the data is valid.
- $validData = $method->validate($form, $boilerplate);
- // Check for validation errors.
- if ($validData === false)
- {
- // Get the validation messages.
- $errors = $method->getErrors();
- // Push up to three validation messages out to the user.
- for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
- {
- if ($errors[$i] instanceof \Exception)
- {
- $app->enqueueMessage($errors[$i]->getMessage(), 'warning');
- }
- else
- {
- $app->enqueueMessage($errors[$i], 'warning');
- }
- }
- return false;
- }
- // Attempt to save the data.
- if (!$method->save($validData))
- {
- $app->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_BOILERPLATE_PLUGIN_S_DATA_COULD_NOT_BE_SAVED', $table), 'error');
- return false;
- }
- return true;
- }
-
/**
* Method to auto-populate the model state.
*
diff --git a/admin/src/Model/Joomla_powersModel.php b/admin/src/Model/Joomla_powersModel.php
index 3e75b0da6..3910dc1a1 100644
--- a/admin/src/Model/Joomla_powersModel.php
+++ b/admin/src/Model/Joomla_powersModel.php
@@ -257,7 +257,7 @@ class Joomla_powersModel extends ListModel
else
{
$search = $db->quote('%' . $db->escape($search) . '%');
- $query->where('(a.system_name LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.description LIKE '.$search.')');
+ $query->where('(a.system_name LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.description LIKE '.$search.' OR a.settings LIKE '.$search.')');
}
}
diff --git a/admin/src/Model/RepositoriesModel.php b/admin/src/Model/RepositoriesModel.php
index ce4096a60..8ce7ecdda 100644
--- a/admin/src/Model/RepositoriesModel.php
+++ b/admin/src/Model/RepositoriesModel.php
@@ -248,9 +248,12 @@ class RepositoriesModel extends ListModel
{
$targetArray = array(
0 => 'COM_COMPONENTBUILDER_REPOSITORY_SELECT_AN_OPTION',
- 1 => 'COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER',
+ 4 => 'COM_COMPONENTBUILDER_REPOSITORY_PACKAGES',
+ 3 => 'COM_COMPONENTBUILDER_REPOSITORY_FIELD_TYPES',
2 => 'COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER',
- 3 => 'COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_FIELD_TYPES'
+ 5 => 'COM_COMPONENTBUILDER_REPOSITORY_SNIPPETS',
+ 1 => 'COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER',
+ 6 => 'COM_COMPONENTBUILDER_REPOSITORY_REPOSITORIES'
);
// Now check if value is found in this array
if (isset($targetArray[$value]) && StringHelper::check($targetArray[$value]))
@@ -263,7 +266,8 @@ class RepositoriesModel extends ListModel
{
$typeArray = array(
0 => 'COM_COMPONENTBUILDER_REPOSITORY_SELECT_AN_OPTION',
- 1 => 'COM_COMPONENTBUILDER_REPOSITORY_GITEA'
+ 1 => 'COM_COMPONENTBUILDER_REPOSITORY_GITEA',
+ 2 => 'COM_COMPONENTBUILDER_REPOSITORY_GITHUB'
);
// Now check if value is found in this array
if (isset($typeArray[$value]) && StringHelper::check($typeArray[$value]))
@@ -338,7 +342,7 @@ class RepositoriesModel extends ListModel
else
{
$search = $db->quote('%' . $db->escape($search) . '%');
- $query->where('(a.organisation LIKE '.$search.' OR a.repository LIKE '.$search.' OR a.target LIKE '.$search.' OR a.type LIKE '.$search.' OR a.base LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.username LIKE '.$search.')');
+ $query->where('(a.organisation LIKE '.$search.' OR a.repository LIKE '.$search.' OR a.target LIKE '.$search.' OR a.type LIKE '.$search.' OR a.base LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.author_email LIKE '.$search.' OR a.author_name LIKE '.$search.' OR a.username LIKE '.$search.')');
}
}
diff --git a/admin/src/Model/RepositoryModel.php b/admin/src/Model/RepositoryModel.php
index d6b8fe22c..e9d9f3105 100644
--- a/admin/src/Model/RepositoryModel.php
+++ b/admin/src/Model/RepositoryModel.php
@@ -58,7 +58,9 @@ class RepositoryModel extends AdminModel
'type',
'base',
'username',
- 'token'
+ 'token',
+ 'author_name',
+ 'author_email'
),
'right' => array(
'organisation',
diff --git a/admin/src/Model/SnippetsModel.php b/admin/src/Model/SnippetsModel.php
index 771319c89..52f4ebb66 100644
--- a/admin/src/Model/SnippetsModel.php
+++ b/admin/src/Model/SnippetsModel.php
@@ -26,8 +26,6 @@ use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\StringHelper;
-use Joomla\CMS\Filesystem\Folder;
-use Joomla\Filesystem\File;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -101,120 +99,6 @@ class SnippetsModel extends ListModel
$this->app ??= Factory::getApplication();
}
- public $user;
- public $zipPath;
-
- /**
- * Method to build the export package
- *
- * @return bool on success.
- */
- public function shareSnippets($pks)
- {
- // setup the query
- if (UtilitiesArrayHelper::check($pks))
- {
- // Get the user object.
- if (!ObjectHelper::check($this->user))
- {
- $this->user = Factory::getUser();
- }
- // Create a new query object.
- if (!ObjectHelper::check($this->_db))
- {
- $this->_db = Factory::getDBO();
- }
- $query = $this->_db->getQuery(true);
-
- // Select some fields
- $query->select($this->_db->quoteName(
- array('a.name','a.heading','a.description','a.usage','a.snippet','a.url','b.name','c.name','a.created','a.modified','a.contributor_company','a.contributor_name','a.contributor_email','a.contributor_website'),
- array('name','heading','description','usage','snippet','url','type','library','created','modified','contributor_company','contributor_name','contributor_email','contributor_website')
- ));
-
- // From the componentbuilder_snippet table
- $query->from($this->_db->quoteName('#__componentbuilder_snippet', 'a'));
- // From the componentbuilder_snippet_type table.
- $query->join('LEFT', $this->_db->quoteName('#__componentbuilder_snippet_type', 'b') . ' ON (' . $this->_db->quoteName('a.type') . ' = ' . $this->_db->quoteName('b.id') . ')');
- // From the componentbuilder_library table.
- $query->join('LEFT', $this->_db->quoteName('#__componentbuilder_library', 'c') . ' ON (' . $this->_db->quoteName('a.library') . ' = ' . $this->_db->quoteName('c.id') . ')');
- $query->where('a.id IN (' . implode(',',$pks) . ')');
-
- // Implement View Level Access
- if (!$this->user->authorise('core.options', 'com_componentbuilder'))
- {
- $groups = implode(',', $this->user->getAuthorisedViewLevels());
- $query->where('a.access IN (' . $groups . ')');
- }
-
- // Order the results by ordering
- $query->order('a.ordering ASC');
-
- // Load the items
- $this->_db->setQuery($query);
- $this->_db->execute();
- if ($this->_db->getNumRows())
- {
- // load the items from db
- $items = $this->_db->loadObjectList();
- // check if we have items
- if (UtilitiesArrayHelper::check($items))
- {
- // get the shared paths
- $this->fullPath = rtrim(ComponentbuilderHelper::getFolderPath('path', 'sharepath', Factory::getConfig()->get('tmp_path')), '/') . '/snippets';
- // remove old folder with the same name
- if (is_dir($this->fullPath))
- {
- // remove if old folder is found
- ComponentbuilderHelper::removeFolder($this->fullPath);
- }
- // create the full path
- Folder::create($this->fullPath);
- // set zip path
- $this->zipPath = $this->fullPath .'.zip';
- // remove old zip files with the same name
- if (is_file($this->zipPath))
- {
- // remove file if found
- File::delete($this->zipPath);
- }
- // prep the item
- foreach($items as $item)
- {
- // just unlock the snippet
- $item->snippet = base64_decode($item->snippet);
- // build filename
- $fileName = StringHelper::safe($item->library . ' - (' . $item->type . ') ' . $item->name, 'filename', '', false) . '.json';
- // if the snippet has its own contributor details set, then do not change
- if (!strlen($item->contributor_company) || !strlen($item->contributor_name) || !strlen($item->contributor_email) || !strlen($item->contributor_website))
- {
- // load the correct contributor details to each snippet (this is very slow)
- $_contributor = ComponentbuilderHelper::getContributorDetails($fileName);
- $item->contributor_company = $_contributor['contributor_company'];
- $item->contributor_name = $_contributor['contributor_name'];
- $item->contributor_email = $_contributor['contributor_email'];
- $item->contributor_website = $_contributor['contributor_website'];
- }
- // now store the snippet info
- ComponentbuilderHelper::writeFile($this->fullPath . '/' . $fileName, json_encode($item, JSON_PRETTY_PRINT));
- }
- // zip the folder
- if (!ComponentbuilderHelper::zip($this->fullPath, $this->zipPath))
- {
- return false;
- }
- // remove the folder
- if (!ComponentbuilderHelper::removeFolder($this->fullPath))
- {
- return false;
- }
- return true;
- }
- }
- }
- return false;
- }
-
/**
* Method to auto-populate the model state.
*
diff --git a/admin/src/View/Admin_custom_tabs/HtmlView.php b/admin/src/View/Admin_custom_tabs/HtmlView.php
index 661b90c44..dec8baef5 100644
--- a/admin/src/View/Admin_custom_tabs/HtmlView.php
+++ b/admin/src/View/Admin_custom_tabs/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Admin_custom_tabs view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_custom_tabs', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('admin_custom_tabs.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('admin_custom_tabs.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('admin_custom_tabs.create'))
+ {
+ ToolbarHelper::apply('admin_custom_tabs.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('admin_custom_tabs.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('admin_custom_tabs.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('admin_custom_tabs.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Admin_fields/HtmlView.php b/admin/src/View/Admin_fields/HtmlView.php
index 53fe34305..f03dec9b5 100644
--- a/admin/src/View/Admin_fields/HtmlView.php
+++ b/admin/src/View/Admin_fields/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Admin_fields view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('admin_fields.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('admin_fields.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('admin_fields.create'))
+ {
+ ToolbarHelper::apply('admin_fields.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('admin_fields.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('admin_fields.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('admin_fields.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Admin_fields_conditions/HtmlView.php b/admin/src/View/Admin_fields_conditions/HtmlView.php
index cbcfa83c0..9e3d935a5 100644
--- a/admin/src/View/Admin_fields_conditions/HtmlView.php
+++ b/admin/src/View/Admin_fields_conditions/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Admin_fields_conditions view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('admin_fields_conditions.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('admin_fields_conditions.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('admin_fields_conditions.create'))
+ {
+ ToolbarHelper::apply('admin_fields_conditions.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('admin_fields_conditions.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('admin_fields_conditions.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('admin_fields_conditions.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Admin_fields_relations/HtmlView.php b/admin/src/View/Admin_fields_relations/HtmlView.php
index 352fa2821..20cfe8fb4 100644
--- a/admin/src/View/Admin_fields_relations/HtmlView.php
+++ b/admin/src/View/Admin_fields_relations/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Admin_fields_relations view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('admin_fields_relations.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('admin_fields_relations.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('admin_fields_relations.create'))
+ {
+ ToolbarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('admin_fields_relations.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Admin_view/HtmlView.php b/admin/src/View/Admin_view/HtmlView.php
index 3a1263da6..9bde56c1c 100644
--- a/admin/src/View/Admin_view/HtmlView.php
+++ b/admin/src/View/Admin_view/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Admin_view view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_view', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('admin_view.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('admin_view.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('admin_view.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('admin_view.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('admin_view.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_VIEW_NEW' : 'COM_COMPONENTBUILDER_ADMIN_VIEW_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('admin_view.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('admin_view.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('admin_view.create'))
+ {
+ ToolbarHelper::apply('admin_view.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('admin_view.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('admin_view.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('admin_view.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('admin_view.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('admin_view.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('admin_view.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('admin_view.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Admin_views/HtmlView.php b/admin/src/View/Admin_views/HtmlView.php
index 8dc9628d3..272c24ec8 100644
--- a/admin/src/View/Admin_views/HtmlView.php
+++ b/admin/src/View/Admin_views/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('admin_views.trash');
}
}
+ if ($this->user->authorise('admin_view.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('admin_views.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('admin_view.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('admin_views.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('admin_view.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('admin_views.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admin_views');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Admins_custom_tabs/HtmlView.php b/admin/src/View/Admins_custom_tabs/HtmlView.php
index 8de77027e..58df48ea9 100644
--- a/admin/src/View/Admins_custom_tabs/HtmlView.php
+++ b/admin/src/View/Admins_custom_tabs/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Admins_fields/HtmlView.php b/admin/src/View/Admins_fields/HtmlView.php
index e30312a8b..17366d14d 100644
--- a/admin/src/View/Admins_fields/HtmlView.php
+++ b/admin/src/View/Admins_fields/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Admins_fields_conditions/HtmlView.php b/admin/src/View/Admins_fields_conditions/HtmlView.php
index 114bf193d..061f723ec 100644
--- a/admin/src/View/Admins_fields_conditions/HtmlView.php
+++ b/admin/src/View/Admins_fields_conditions/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Admins_fields_relations/HtmlView.php b/admin/src/View/Admins_fields_relations/HtmlView.php
index 2b8264544..51befddb1 100644
--- a/admin/src/View/Admins_fields_relations/HtmlView.php
+++ b/admin/src/View/Admins_fields_relations/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Class_extendings/HtmlView.php b/admin/src/View/Class_extendings/HtmlView.php
index 8386af059..ce1c967e5 100644
--- a/admin/src/View/Class_extendings/HtmlView.php
+++ b/admin/src/View/Class_extendings/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('class_extendings.trash');
}
}
+ if ($this->user->authorise('class_extends.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('class_extendings.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('class_extends.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_extendings.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('class_extends.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_extendings.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_extendings');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Class_extends/HtmlView.php b/admin/src/View/Class_extends/HtmlView.php
index 33d82329a..127b1ac93 100644
--- a/admin/src/View/Class_extends/HtmlView.php
+++ b/admin/src/View/Class_extends/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Class_extends view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_extends', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('class_extends.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('class_extends.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_extends.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('class_extends.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_extends.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('class_extends.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('class_extends.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('class_extends.create'))
+ {
+ ToolbarHelper::apply('class_extends.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('class_extends.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('class_extends.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('class_extends.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('class_extends.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_extends.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('class_extends.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_extends.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Class_method/HtmlView.php b/admin/src/View/Class_method/HtmlView.php
index 31fbbcd74..ab0bf7037 100644
--- a/admin/src/View/Class_method/HtmlView.php
+++ b/admin/src/View/Class_method/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Class_method view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_method', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('class_method.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('class_method.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_method.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('class_method.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_method.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('class_method.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('class_method.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('class_method.create'))
+ {
+ ToolbarHelper::apply('class_method.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('class_method.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('class_method.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('class_method.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('class_method.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_method.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('class_method.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_method.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Class_methods/HtmlView.php b/admin/src/View/Class_methods/HtmlView.php
index ee7db4a3e..65344b560 100644
--- a/admin/src/View/Class_methods/HtmlView.php
+++ b/admin/src/View/Class_methods/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('class_methods.trash');
}
}
+ if ($this->user->authorise('class_method.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('class_methods.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('class_method.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_methods.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('class_method.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_methods.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_methods');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Class_properties/HtmlView.php b/admin/src/View/Class_properties/HtmlView.php
index 897489f67..b91d3ad35 100644
--- a/admin/src/View/Class_properties/HtmlView.php
+++ b/admin/src/View/Class_properties/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('class_properties.trash');
}
}
+ if ($this->user->authorise('class_property.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('class_properties.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('class_property.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_properties.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('class_property.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_properties.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_properties');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Class_property/HtmlView.php b/admin/src/View/Class_property/HtmlView.php
index a70dd4356..77ba30a81 100644
--- a/admin/src/View/Class_property/HtmlView.php
+++ b/admin/src/View/Class_property/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Class_property view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_property', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('class_property.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('class_property.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_property.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('class_property.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_property.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('class_property.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('class_property.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('class_property.create'))
+ {
+ ToolbarHelper::apply('class_property.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('class_property.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('class_property.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('class_property.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('class_property.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('class_property.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('class_property.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('class_property.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Compiler/HtmlView.php b/admin/src/View/Compiler/HtmlView.php
index 2fab37b58..4b1e01223 100644
--- a/admin/src/View/Compiler/HtmlView.php
+++ b/admin/src/View/Compiler/HtmlView.php
@@ -23,7 +23,7 @@ use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\HeaderCheck;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use Joomla\CMS\Form\Form;
-use Joomla\CMS\Filesystem\File;
+use Joomla\Filesystem\File;
use Joomla\CMS\Layout\LayoutHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\FormHelper;
diff --git a/admin/src/View/Component_admin_views/HtmlView.php b/admin/src/View/Component_admin_views/HtmlView.php
index 3485454ef..857b115c0 100644
--- a/admin/src/View/Component_admin_views/HtmlView.php
+++ b/admin/src/View/Component_admin_views/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_admin_views view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_admin_views.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_admin_views.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_admin_views.create'))
+ {
+ ToolbarHelper::apply('component_admin_views.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_admin_views.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_admin_views.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_config/HtmlView.php b/admin/src/View/Component_config/HtmlView.php
index 7853905f7..0d1316e34 100644
--- a/admin/src/View/Component_config/HtmlView.php
+++ b/admin/src/View/Component_config/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_config view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_config', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_config.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_config.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_config.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_config.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_config.create'))
+ {
+ ToolbarHelper::apply('component_config.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_config.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_config.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_config.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_config.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_config.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_custom_admin_menus/HtmlView.php b/admin/src/View/Component_custom_admin_menus/HtmlView.php
index 8369dabfd..006f96b17 100644
--- a/admin/src/View/Component_custom_admin_menus/HtmlView.php
+++ b/admin/src/View/Component_custom_admin_menus/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_custom_admin_menus view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_custom_admin_menus.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_custom_admin_menus.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_custom_admin_menus.create'))
+ {
+ ToolbarHelper::apply('component_custom_admin_menus.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_custom_admin_menus.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_custom_admin_menus.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_custom_admin_menus.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_custom_admin_views/HtmlView.php b/admin/src/View/Component_custom_admin_views/HtmlView.php
index a67f0f3bc..dd8d6aac7 100644
--- a/admin/src/View/Component_custom_admin_views/HtmlView.php
+++ b/admin/src/View/Component_custom_admin_views/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_custom_admin_views view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_custom_admin_views.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_custom_admin_views.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_custom_admin_views.create'))
+ {
+ ToolbarHelper::apply('component_custom_admin_views.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_custom_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_custom_admin_views.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_custom_admin_views.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_dashboard/HtmlView.php b/admin/src/View/Component_dashboard/HtmlView.php
index 95c53b645..2f9a767ca 100644
--- a/admin/src/View/Component_dashboard/HtmlView.php
+++ b/admin/src/View/Component_dashboard/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_dashboard view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_dashboard.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_dashboard.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_dashboard.create'))
+ {
+ ToolbarHelper::apply('component_dashboard.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_dashboard.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_dashboard.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_dashboard.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_files_folders/HtmlView.php b/admin/src/View/Component_files_folders/HtmlView.php
index 9c2ddc95e..64cb9841e 100644
--- a/admin/src/View/Component_files_folders/HtmlView.php
+++ b/admin/src/View/Component_files_folders/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_files_folders view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_files_folders.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_files_folders.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_files_folders.create'))
+ {
+ ToolbarHelper::apply('component_files_folders.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_files_folders.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_files_folders.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_files_folders.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_modules/HtmlView.php b/admin/src/View/Component_modules/HtmlView.php
index fd0f2a7c6..ba35c62a1 100644
--- a/admin/src/View/Component_modules/HtmlView.php
+++ b/admin/src/View/Component_modules/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_modules view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_modules', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_MODULES_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_MODULES_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_modules.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_modules.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_modules.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_modules.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_modules.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_modules.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_modules.create'))
+ {
+ ToolbarHelper::apply('component_modules.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_modules.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_modules.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_modules.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_modules.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_modules.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_modules.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_modules.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_mysql_tweaks/HtmlView.php b/admin/src/View/Component_mysql_tweaks/HtmlView.php
index 2cd557139..939ca8257 100644
--- a/admin/src/View/Component_mysql_tweaks/HtmlView.php
+++ b/admin/src/View/Component_mysql_tweaks/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_mysql_tweaks view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_mysql_tweaks.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_mysql_tweaks.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_mysql_tweaks.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_mysql_tweaks.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_mysql_tweaks.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_mysql_tweaks.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_mysql_tweaks.create'))
+ {
+ ToolbarHelper::apply('component_mysql_tweaks.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_mysql_tweaks.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_mysql_tweaks.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_mysql_tweaks.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_mysql_tweaks.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_mysql_tweaks.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_mysql_tweaks.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_mysql_tweaks.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_placeholders/HtmlView.php b/admin/src/View/Component_placeholders/HtmlView.php
index 2ca037603..4c67ee71c 100644
--- a/admin/src/View/Component_placeholders/HtmlView.php
+++ b/admin/src/View/Component_placeholders/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_placeholders view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_placeholders', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_placeholders.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_placeholders.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_placeholders.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_placeholders.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_placeholders.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_placeholders.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_placeholders.create'))
+ {
+ ToolbarHelper::apply('component_placeholders.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_placeholders.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_placeholders.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_placeholders.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_placeholders.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_placeholders.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_placeholders.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_placeholders.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_plugins/HtmlView.php b/admin/src/View/Component_plugins/HtmlView.php
index 758bffa58..d9a588661 100644
--- a/admin/src/View/Component_plugins/HtmlView.php
+++ b/admin/src/View/Component_plugins/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_plugins view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_plugins', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_PLUGINS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_PLUGINS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_plugins.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_plugins.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_plugins.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_plugins.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_plugins.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_plugins.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_plugins.create'))
+ {
+ ToolbarHelper::apply('component_plugins.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_plugins.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_plugins.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_plugins.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_plugins.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_plugins.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_plugins.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_plugins.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_router/HtmlView.php b/admin/src/View/Component_router/HtmlView.php
index f748e8ce8..0df32aa54 100644
--- a/admin/src/View/Component_router/HtmlView.php
+++ b/admin/src/View/Component_router/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_router view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_router', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_router.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_router.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_router.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_router.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_router.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_router.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_router.create'))
+ {
+ ToolbarHelper::apply('component_router.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_router.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_router.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_router.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_router.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_router.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_router.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_router.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_site_views/HtmlView.php b/admin/src/View/Component_site_views/HtmlView.php
index 17f7cad06..94ab51726 100644
--- a/admin/src/View/Component_site_views/HtmlView.php
+++ b/admin/src/View/Component_site_views/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_site_views view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_site_views', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_site_views.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_site_views.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_site_views.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_site_views.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_site_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_site_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_site_views.create'))
+ {
+ ToolbarHelper::apply('component_site_views.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_site_views.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_site_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_site_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_site_views.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_site_views.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_site_views.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_site_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Component_updates/HtmlView.php b/admin/src/View/Component_updates/HtmlView.php
index b1f0a6358..0680bbc94 100644
--- a/admin/src/View/Component_updates/HtmlView.php
+++ b/admin/src/View/Component_updates/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Component_updates view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_updates', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_UPDATES_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_UPDATES_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('component_updates.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('component_updates.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_updates.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('component_updates.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('component_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('component_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_updates.create'))
+ {
+ ToolbarHelper::apply('component_updates.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_updates.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('component_updates.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('component_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_updates.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('component_updates.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('component_updates.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('component_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Componentbuilder/HtmlView.php b/admin/src/View/Componentbuilder/HtmlView.php
index cb2731c2a..9c1cbaa6a 100644
--- a/admin/src/View/Componentbuilder/HtmlView.php
+++ b/admin/src/View/Componentbuilder/HtmlView.php
@@ -30,6 +30,60 @@ use VDM\Joomla\Utilities\StringHelper;
#[\AllowDynamicProperties]
class HtmlView extends BaseHtmlView
{
+ /**
+ * @var array List of icon identifiers to render in the dashboard view.
+ * @since 1.6
+ */
+ public array $icons = [];
+
+ /**
+ * @var array List of CSS file URLs to be added to the page.
+ * @since 4.3
+ */
+ public array $styles = [];
+
+ /**
+ * @var array List of JavaScript file URLs to be included on the page.
+ * @since 4.3
+ */
+ public array $scripts = [];
+
+ /**
+ * @var array List of contributor objects fetched via the helper.
+ * @since 1.6
+ */
+ public array $contributors = [];
+
+ /**
+ * @var object|null The manifest metadata of the component as returned by `ComponentbuilderHelper::manifest()`.
+ * @since 1.6
+ */
+ public $manifest = null;
+
+ /**
+ * @var string|null Markdown content of the component's wiki page.
+ * @since 1.6
+ */
+ public ?string $wiki = null;
+
+ /**
+ * @var string|null The rendered or raw README markdown of the component.
+ * @since 1.6
+ */
+ public ?string $readme = null;
+
+ /**
+ * @var string|null The current version of the component.
+ * @since 1.6
+ */
+ public ?string $version = null;
+
+ /**
+ * @var string|null Help URL for the component dashboard view, if available.
+ * @since 1.6
+ */
+ public ?string $help_url = null;
+
/**
* View display method
*
@@ -101,8 +155,12 @@ class HtmlView extends BaseHtmlView
{
// set page title
$this->getDocument()->setTitle(Text::_('COM_COMPONENTBUILDER_DASHBOARD'));
- // add manifest to page JavaScript
- $this->getDocument()->addScriptDeclaration("var manifest = JSON.parse(" . json_encode($this->manifest) . ");", "text/javascript");
+ /** \Joomla\CMS\WebAsset\WebAssetManager $wa */
+ $wa = $this->getDocument()->getWebAssetManager();
+ // Register the inline script with properly encoded JSON
+ $wa->addInlineScript(
+ 'var manifest = ' . json_encode($this->manifest, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . ';'
+ );
// add styles
foreach ($this->styles as $style)
{
diff --git a/admin/src/View/Components_admin_views/HtmlView.php b/admin/src/View/Components_admin_views/HtmlView.php
index f1383486f..374c088e5 100644
--- a/admin/src/View/Components_admin_views/HtmlView.php
+++ b/admin/src/View/Components_admin_views/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_config/HtmlView.php b/admin/src/View/Components_config/HtmlView.php
index fafa2fc43..0d2037173 100644
--- a/admin/src/View/Components_config/HtmlView.php
+++ b/admin/src/View/Components_config/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_custom_admin_menus/HtmlView.php b/admin/src/View/Components_custom_admin_menus/HtmlView.php
index 3818492c6..edb19f336 100644
--- a/admin/src/View/Components_custom_admin_menus/HtmlView.php
+++ b/admin/src/View/Components_custom_admin_menus/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_custom_admin_views/HtmlView.php b/admin/src/View/Components_custom_admin_views/HtmlView.php
index 2f570315a..a6f3ce074 100644
--- a/admin/src/View/Components_custom_admin_views/HtmlView.php
+++ b/admin/src/View/Components_custom_admin_views/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_dashboard/HtmlView.php b/admin/src/View/Components_dashboard/HtmlView.php
index c6fa187f1..4a95f81f9 100644
--- a/admin/src/View/Components_dashboard/HtmlView.php
+++ b/admin/src/View/Components_dashboard/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_files_folders/HtmlView.php b/admin/src/View/Components_files_folders/HtmlView.php
index 0064ab913..8e0673ff2 100644
--- a/admin/src/View/Components_files_folders/HtmlView.php
+++ b/admin/src/View/Components_files_folders/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_modules/HtmlView.php b/admin/src/View/Components_modules/HtmlView.php
index 128bcd6cc..abd3b9e99 100644
--- a/admin/src/View/Components_modules/HtmlView.php
+++ b/admin/src/View/Components_modules/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_mysql_tweaks/HtmlView.php b/admin/src/View/Components_mysql_tweaks/HtmlView.php
index d516b0c7a..3a3d02b92 100644
--- a/admin/src/View/Components_mysql_tweaks/HtmlView.php
+++ b/admin/src/View/Components_mysql_tweaks/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_placeholders/HtmlView.php b/admin/src/View/Components_placeholders/HtmlView.php
index 6923846ca..efff7d923 100644
--- a/admin/src/View/Components_placeholders/HtmlView.php
+++ b/admin/src/View/Components_placeholders/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_plugins/HtmlView.php b/admin/src/View/Components_plugins/HtmlView.php
index 895055334..55c7378d0 100644
--- a/admin/src/View/Components_plugins/HtmlView.php
+++ b/admin/src/View/Components_plugins/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_routers/HtmlView.php b/admin/src/View/Components_routers/HtmlView.php
index 38c5431a8..fc6de9f30 100644
--- a/admin/src/View/Components_routers/HtmlView.php
+++ b/admin/src/View/Components_routers/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_site_views/HtmlView.php b/admin/src/View/Components_site_views/HtmlView.php
index 79d3b8e4a..459be667c 100644
--- a/admin/src/View/Components_site_views/HtmlView.php
+++ b/admin/src/View/Components_site_views/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Components_updates/HtmlView.php b/admin/src/View/Components_updates/HtmlView.php
index c5e62adf2..c2e8da057 100644
--- a/admin/src/View/Components_updates/HtmlView.php
+++ b/admin/src/View/Components_updates/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Custom_admin_view/HtmlView.php b/admin/src/View/Custom_admin_view/HtmlView.php
index ee1a08e04..dad828f84 100644
--- a/admin/src/View/Custom_admin_view/HtmlView.php
+++ b/admin/src/View/Custom_admin_view/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Custom_admin_view view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('custom_admin_view', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('custom_admin_view.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('custom_admin_view.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('custom_admin_view.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('custom_admin_view.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('custom_admin_view.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('custom_admin_view.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NEW' : 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('core.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('custom_admin_view.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('core.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('custom_admin_view.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('custom_admin_view.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('custom_admin_view.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('core.create'))
+ {
+ ToolbarHelper::apply('custom_admin_view.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('custom_admin_view.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('custom_admin_view.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('custom_admin_view.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('core.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('custom_admin_view.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('custom_admin_view.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('custom_admin_view.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('custom_admin_view.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('custom_admin_view.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('custom_admin_view.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('custom_admin_view.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Custom_admin_views/HtmlView.php b/admin/src/View/Custom_admin_views/HtmlView.php
index f241baa75..5b5738398 100644
--- a/admin/src/View/Custom_admin_views/HtmlView.php
+++ b/admin/src/View/Custom_admin_views/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,10 +218,20 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('custom_admin_views.trash');
}
}
- if ($this->user->authorise('custom_admin_view.get_snippets', 'com_componentbuilder'))
+ if ($this->user->authorise('custom_admin_view.init', 'com_componentbuilder'))
{
- // add Get Snippets button.
- ToolbarHelper::custom('custom_admin_views.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false);
+ // add Init button.
+ ToolbarHelper::custom('custom_admin_views.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('custom_admin_view.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('custom_admin_views.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('custom_admin_view.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('custom_admin_views.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -263,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Custom_code/HtmlView.php b/admin/src/View/Custom_code/HtmlView.php
index 0c08e2059..84161dd82 100644
--- a/admin/src/View/Custom_code/HtmlView.php
+++ b/admin/src/View/Custom_code/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Custom_code view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('custom_code', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('custom_code.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('custom_code.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('custom_code.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('custom_code.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('custom_code.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('custom_code.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_CUSTOM_CODE_NEW' : 'COM_COMPONENTBUILDER_CUSTOM_CODE_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('custom_code.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('custom_code.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('custom_code.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('custom_code.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('custom_code.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('custom_code.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('custom_code.create'))
+ {
+ ToolbarHelper::apply('custom_code.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('custom_code.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('custom_code.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('custom_code.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('custom_code.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('custom_code.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('custom_code.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('custom_code.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('custom_code.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('custom_code.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('custom_code.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('custom_code.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Custom_codes/HtmlView.php b/admin/src/View/Custom_codes/HtmlView.php
index 3c2a3bfb6..b3202ab89 100644
--- a/admin/src/View/Custom_codes/HtmlView.php
+++ b/admin/src/View/Custom_codes/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,10 +218,20 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('custom_codes.trash');
}
}
- if ($this->user->authorise('custom_code.run_expansion', 'com_componentbuilder'))
+ if ($this->user->authorise('custom_code.init', 'com_componentbuilder'))
{
- // add Run Expansion button.
- ToolbarHelper::custom('custom_codes.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false);
+ // add Init button.
+ ToolbarHelper::custom('custom_codes.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('custom_code.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('custom_codes.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('custom_code.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('custom_codes.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -263,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Dynamic_get/HtmlView.php b/admin/src/View/Dynamic_get/HtmlView.php
index 8b91f8cbb..7bf7d86c0 100644
--- a/admin/src/View/Dynamic_get/HtmlView.php
+++ b/admin/src/View/Dynamic_get/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Dynamic_get view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('dynamic_get', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('dynamic_get.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('dynamic_get.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('dynamic_get.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('dynamic_get.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('dynamic_get.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('dynamic_get.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('dynamic_get.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('dynamic_get.create'))
+ {
+ ToolbarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('dynamic_get.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('dynamic_get.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('dynamic_get.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('dynamic_get.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('dynamic_get.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Dynamic_gets/HtmlView.php b/admin/src/View/Dynamic_gets/HtmlView.php
index 16df5eb4b..91afd7cd9 100644
--- a/admin/src/View/Dynamic_gets/HtmlView.php
+++ b/admin/src/View/Dynamic_gets/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('dynamic_gets.trash');
}
}
+ if ($this->user->authorise('dynamic_get.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('dynamic_gets.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('dynamic_get.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('dynamic_gets.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('dynamic_get.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('dynamic_gets.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('dynamic_gets');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Field/HtmlView.php b/admin/src/View/Field/HtmlView.php
index d18d249e8..b90e94b52 100644
--- a/admin/src/View/Field/HtmlView.php
+++ b/admin/src/View/Field/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Field view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('field', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('field.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('field.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('field.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('field.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('field.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('field.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('field.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('field.create'))
+ {
+ ToolbarHelper::apply('field.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('field.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('field.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('field.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('field.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('field.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('field.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Fields/HtmlView.php b/admin/src/View/Fields/HtmlView.php
index 05d32eef5..9d73170e2 100644
--- a/admin/src/View/Fields/HtmlView.php
+++ b/admin/src/View/Fields/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('fields.trash');
}
}
+ if ($this->user->authorise('field.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('fields.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('field.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('fields.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('field.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('fields.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('fields');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Fieldtype/HtmlView.php b/admin/src/View/Fieldtype/HtmlView.php
index 74430f6b6..1964505be 100644
--- a/admin/src/View/Fieldtype/HtmlView.php
+++ b/admin/src/View/Fieldtype/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Fieldtype view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('fieldtype', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -164,11 +181,17 @@ class HtmlView extends BaseHtmlView
$this->referral .= '&return=' . (string) $return;
}
- // Get Linked view data
- $this->vxlfields = $this->get('Vxlfields');
-
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -183,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -266,7 +289,7 @@ class HtmlView extends BaseHtmlView
if ($this->canDo->get('fieldtype.push'))
{
// add Push button.
- ToolbarHelper::custom('fieldtype.pushPowers', 'joomla custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ ToolbarHelper::custom('fieldtype.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
ToolbarHelper::cancel('fieldtype.cancel', 'JTOOLBAR_CLOSE');
}
@@ -281,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_FIELDTYPE_NEW' : 'COM_COMPONENTBUILDER_FIELDTYPE_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('fieldtype.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('fieldtype.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('fieldtype.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('fieldtype.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('fieldtype.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('fieldtype.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('fieldtype.create'))
+ {
+ ToolbarHelper::apply('fieldtype.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('fieldtype.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('fieldtype.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('fieldtype.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('fieldtype.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('fieldtype.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('fieldtype.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('fieldtype.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('fieldtype.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('fieldtype.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('fieldtype.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('fieldtype.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
@@ -320,16 +418,6 @@ class HtmlView extends BaseHtmlView
}
// Add Ajax Token
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
-
- // Add the CSS for Footable
- Html::_('stylesheet', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', ['version' => 'auto']);
- Html::_('stylesheet', 'media/com_componentbuilder/footable-v3/css/footable.standalone.min.css', ['version' => 'auto']);
- // Add the JavaScript for Footable (adding all functions)
- Html::_('script', 'media/com_componentbuilder/footable-v3/js/footable.min.js', ['version' => 'auto']);
-
- $footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('.footable').footable();});});";
- $this->getDocument()->addScriptDeclaration($footable);
-
// add scripts
foreach ($this->scripts as $script)
{
diff --git a/admin/src/View/Fieldtypes/HtmlView.php b/admin/src/View/Fieldtypes/HtmlView.php
index 196445505..d6b0fc2ff 100644
--- a/admin/src/View/Fieldtypes/HtmlView.php
+++ b/admin/src/View/Fieldtypes/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -213,7 +231,7 @@ class HtmlView extends BaseHtmlView
if ($this->user->authorise('fieldtype.push', 'com_componentbuilder'))
{
// add Push button.
- ToolbarHelper::custom('fieldtypes.pushPowers', 'joomla custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ ToolbarHelper::custom('fieldtypes.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -273,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Get_snippets/HtmlView.php b/admin/src/View/Get_snippets/HtmlView.php
deleted file mode 100644
index a487682af..000000000
--- a/admin/src/View/Get_snippets/HtmlView.php
+++ /dev/null
@@ -1,397 +0,0 @@
-
- * @git Joomla Component Builder
- * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- */
-namespace VDM\Component\Componentbuilder\Administrator\View\Get_snippets;
-
-use Joomla\CMS\Factory;
-use Joomla\CMS\Language\Text;
-use Joomla\CMS\Component\ComponentHelper;
-use Joomla\CMS\HTML\HTMLHelper as Html;
-use Joomla\CMS\Layout\FileLayout;
-use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
-use Joomla\CMS\Plugin\PluginHelper;
-use Joomla\CMS\Toolbar\ToolbarHelper;
-use Joomla\CMS\User\User;
-use Joomla\CMS\Document\Document;
-use VDM\Component\Componentbuilder\Administrator\Helper\HeaderCheck;
-use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
-use Joomla\CMS\Filesystem\File;
-use VDM\Joomla\Utilities\ArrayHelper;
-use VDM\Joomla\Utilities\StringHelper;
-use Joomla\CMS\Session\Session;
-
-// No direct access to this file
-\defined('_JEXEC') or die;
-
-/**
- * Componentbuilder Html View class for the Get_snippets
- *
- * @since 1.6
- */
-#[\AllowDynamicProperties]
-class HtmlView extends BaseHtmlView
-{
- /**
- * The styles url array
- *
- * @var array
- * @since 5.0.0
- */
- protected array $styles;
-
- /**
- * The scripts url array
- *
- * @var array
- * @since 5.0.0
- */
- protected array $scripts;
-
- /**
- * The actions object
- *
- * @var object
- * @since 3.10.11
- */
- public object $canDo;
-
- /**
- * The user object.
- *
- * @var User
- * @since 3.10.11
- */
- public User $user;
-
- /**
- * Display the view
- *
- * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
- *
- * @return void
- * @throws \Exception
- * @since 1.6
- */
- public function display($tpl = null): void
- {
- // get component params
- $this->params = ComponentHelper::getParams('com_componentbuilder');
- // get the application
- $this->app ??= Factory::getApplication();
- // get the user object
- $this->user ??= $this->getCurrentUser();
- // get global action permissions
- $this->canDo = ComponentbuilderHelper::getActions('get_snippets');
- $this->styles = $this->get('Styles') ?? [];
- $this->scripts = $this->get('Scripts') ?? [];
- // Initialise variables.
- $this->items = $this->get('Items');
-
- // We don't need toolbar in the modal window.
- if ($this->getLayout() !== 'modal')
- {
- // add the tool bar
- $this->addToolBar();
- }
-
- // Check for errors.
- if (count($errors = $this->get('Errors')))
- {
- throw new \Exception(implode(PHP_EOL, $errors), 500);
- }
-
- // Set the html view document stuff
- $this->_prepareDocument();
-
- parent::display($tpl);
- }
-
- /**
- * Prepare some document related stuff.
- *
- * @return void
- * @since 1.6
- */
- protected function _prepareDocument(): void
- {
-
- // Only load jQuery if needed. (default is true)
- if ($this->params->get('add_jquery_framework', 1) == 1)
- {
- Html::_('jquery.framework');
- }
- // Load the header checker class.
- // Initialize the header checker.
- $HeaderCheck = new HeaderCheck();
-
- // Add View JavaScript File
- Html::_('script', "administrator/components/com_componentbuilder/assets/js/get_snippets.js", ['version' => 'auto']);
-
- // Load uikit options.
- $uikit = $this->params->get('uikit_load');
- // Set script size.
- $size = $this->params->get('uikit_min');
- // Set css style.
- $style = $this->params->get('uikit_style');
-
- // The uikit css.
- if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
- {
- Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']);
- }
- // The uikit js.
- if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
- {
- Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
- }
-
- // Load the script to find all uikit components needed.
- if ($uikit != 2)
- {
- // Set the default uikit components in this view.
- $uikitComp = [];
- $uikitComp[] = 'data-uk-grid';
- }
-
- // Load the needed uikit components in this view.
- if ($uikit != 2 && isset($uikitComp) && ArrayHelper::check($uikitComp))
- {
- // loading...
- foreach ($uikitComp as $class)
- {
- foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
- {
- // check if the CSS file exists.
- if (@file_exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
- {
- // load the css.
- Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
- }
- // check if the JavaScript file exists.
- if (@file_exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
- {
- // load the js.
- Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
- }
- }
- }
- }
- // load the local snippets
- if (ArrayHelper::check($this->items))
- {
- $local_snippets = array();
- foreach ($this->items as $item)
- {
- $path = StringHelper::safe($item->library . ' - (' . $item->type . ') ' . $item->name, 'filename', '', false). '.json';
- $local_snippets[$path] = $item;
- }
- }
-
- // Add the JavaScript for JStore
- Html::_('script', 'media/com_componentbuilder/js/jquery.json.min.js', ['version' => 'auto']);
- Html::_('script', 'media/com_componentbuilder/js/jstorage.min.js', ['version' => 'auto']);
- Html::_('script', 'media/com_componentbuilder/js/strtotime.js', ['version' => 'auto']);
- // check if we should use browser storage
- $setBrowserStorage = $this->params->get('set_browser_storage', null);
- if ($setBrowserStorage)
- {
- // check what (Time To Live) show we use
- $storageTimeToLive = $this->params->get('storage_time_to_live', 'global');
- if ('global' == $storageTimeToLive)
- {
- // use the global session time
- $session = Factory::getSession();
- // must have itin milliseconds
- $expire = ($session->getExpire()*60)* 1000;
- }
- else
- {
- // use the Componentbuilder Global setting
- if (0 != $storageTimeToLive)
- {
- // this will convert the time into milliseconds
- $storageTimeToLive = $storageTimeToLive * 1000;
- }
- $expire = $storageTimeToLive;
- }
- }
- else
- {
- // set to use no storage
- $expire = 30000; // only 30 seconds
- }
- // Set the Time To Live To JavaScript
- $this->getDocument()->addScriptDeclaration("var expire = ". (int) $expire.";");
- // set snippet path
- $this->getDocument()->addScriptDeclaration("var snippetPath = '". ComponentbuilderHelper::$snippetPath ."';");
- $this->getDocument()->addScriptDeclaration("var snippetsPath = '". ComponentbuilderHelper::$snippetsPath ."';");
- // token
- $this->getDocument()->addScriptDeclaration("var token = '". Session::getFormToken() ."';");
- // add some global items buckets for bulk updating
- $this->getDocument()->addScriptDeclaration("var bulkItems = {};");
- $this->getDocument()->addScriptDeclaration("bulkItems.new = [];");
- $this->getDocument()->addScriptDeclaration("bulkItems.diverged = [];");
- $this->getDocument()->addScriptDeclaration("bulkItems.ahead = [];");
- $this->getDocument()->addScriptDeclaration("bulkItems.behind = [];");
- // set an error message if needed
- $this->getDocument()->addScriptDeclaration("var returnError = '".Text::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."! ".Text::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".
';");
- // need to add some language strings
- Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS');
- Text::script('COM_COMPONENTBUILDER_SNIPPETS');
- Text::script('COM_COMPONENTBUILDER_SNIPPET');
- Text::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION');
- Text::script('COM_COMPONENTBUILDER_GET_SNIPPET');
- Text::script('COM_COMPONENTBUILDER_LOCAL_SNIPPET');
- Text::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION');
- Text::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY');
- Text::script('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION');
- Text::script('COM_COMPONENTBUILDER_USAGE');
- Text::script('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION');
- Text::script('COM_COMPONENTBUILDER_DESCRIPTION');
- Text::script('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION');
- Text::script('COM_COMPONENTBUILDER_VIEW_BLAME');
- Text::script('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET');
- Text::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL');
- Text::script('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED');
- Text::script('COM_COMPONENTBUILDER_SNIPPETS_COULD_NOT_BE_UPDATEDSAVED');
- Text::script('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR');
- Text::script('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS');
- Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY');
- Text::script('COM_COMPONENTBUILDER_COMPANY_NAME');
- Text::script('COM_COMPONENTBUILDER_AUTHOR_NAME');
- Text::script('COM_COMPONENTBUILDER_AUTHOR_EMAIL');
- Text::script('COM_COMPONENTBUILDER_AUTHOR_WEBSITE');
- Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME');
- Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME');
- Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME');
- Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME');
- Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME');
- Text::script('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES');
- Text::script('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS');
- // add some lang verfy messages
- $this->getDocument()->addScriptDeclaration("
- // set the snippet from gitHub
- function getConfirmUpdate(status) {
- switch(status) {
- case 'new':
- return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_ADD_THIS_NEW_JCB_COMMUNITY_SNIPPET_TO_YOUR_LOCAL_SNIPPETS')."';
- break;
- case 'behind':
- return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET')."';
- break;
- case 'ahead':
- return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET')."';
- break;
- case 'diverged':
- return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET')."';
- break;
- default:
- return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE')."';
- break;
- }
- }
- ");
- // load the local snippets
- if (ArrayHelper::check($this->items))
- {
- // Set the local snippets array
- $this->getDocument()->addScriptDeclaration("var local_snippets = ". json_encode($local_snippets).";");
- }
- // add styles
- foreach ($this->styles as $style)
- {
- Html::_('stylesheet', $style, ['version' => 'auto']);
- }
- // add scripts
- foreach ($this->scripts as $script)
- {
- Html::_('script', $script, ['version' => 'auto']);
- }
- }
-
- /**
- * Add the page title and toolbar.
- *
- * @return void
- * @since 1.6
- */
- protected function addToolbar(): void
- {
- // hide the main menu
- $this->app->input->set('hidemainmenu', true);
- // add title to the page
- ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_GET_SNIPPETS'),'search');
- // add cpanel button
- ToolbarHelper::custom('get_snippets.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false);
- if ($this->canDo->get('get_snippets.custom_admin_views'))
- {
- // add Custom Admin Views button.
- ToolbarHelper::custom('get_snippets.openCustomAdminViews', 'screen custom-button-opencustomadminviews', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false);
- }
- if ($this->canDo->get('get_snippets.site_views'))
- {
- // add Site Views button.
- ToolbarHelper::custom('get_snippets.openSiteViews', 'palette custom-button-opensiteviews', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false);
- }
- if ($this->canDo->get('get_snippets.templates'))
- {
- // add Templates button.
- ToolbarHelper::custom('get_snippets.openTemplates', 'brush custom-button-opentemplates', '', 'COM_COMPONENTBUILDER_TEMPLATES', false);
- }
- if ($this->canDo->get('get_snippets.layouts'))
- {
- // add Layouts button.
- ToolbarHelper::custom('get_snippets.openLayouts', 'brush custom-button-openlayouts', '', 'COM_COMPONENTBUILDER_LAYOUTS', false);
- }
- if ($this->canDo->get('get_snippets.snippets'))
- {
- // add Snippets button.
- ToolbarHelper::custom('get_snippets.openSnippets', 'pin custom-button-opensnippets', '', 'COM_COMPONENTBUILDER_SNIPPETS', false);
- }
- if ($this->canDo->get('get_snippets.libraries'))
- {
- // add Libraries button.
- ToolbarHelper::custom('get_snippets.openLibraries', 'puzzle custom-button-openlibraries', '', 'COM_COMPONENTBUILDER_LIBRARIES', false);
- }
-
- // set help url for this view if found
- $this->help_url = ComponentbuilderHelper::getHelpUrl('get_snippets');
- if (StringHelper::check($this->help_url))
- {
- ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
- }
-
- // add the options comp button
- if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
- {
- ToolbarHelper::preferences('com_componentbuilder');
- }
- }
-
- /**
- * Escapes a value for output in a view script.
- *
- * @param mixed $var The output to escape.
- * @param bool $shorten The switch to shorten.
- * @param int $length The shorting length.
- *
- * @return mixed The escaped value.
- * @since 1.6
- */
- public function escape($var, bool $shorten = false, int $length = 40)
- {
- if (!is_string($var))
- {
- return $var;
- }
-
- return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
- }
-}
diff --git a/admin/src/View/Help_document/HtmlView.php b/admin/src/View/Help_document/HtmlView.php
index 989170ab0..414e41427 100644
--- a/admin/src/View/Help_document/HtmlView.php
+++ b/admin/src/View/Help_document/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Help_document view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('help_document', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('help_document.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('help_document.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('help_document.create'))
+ {
+ ToolbarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('help_document.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Help_documents/HtmlView.php b/admin/src/View/Help_documents/HtmlView.php
index 1d9868b22..b3f79a61e 100644
--- a/admin/src/View/Help_documents/HtmlView.php
+++ b/admin/src/View/Help_documents/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Initialization_selection/HtmlView.php b/admin/src/View/Initialization_selection/HtmlView.php
new file mode 100644
index 000000000..0daaf76af
--- /dev/null
+++ b/admin/src/View/Initialization_selection/HtmlView.php
@@ -0,0 +1,211 @@
+
+ * @git Joomla Component Builder
+ * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+namespace VDM\Component\Componentbuilder\Administrator\View\Initialization_selection;
+
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\HTML\HTMLHelper as Html;
+use Joomla\CMS\Layout\FileLayout;
+use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
+use Joomla\CMS\Plugin\PluginHelper;
+use Joomla\CMS\Toolbar\ToolbarHelper;
+use Joomla\CMS\User\User;
+use Joomla\CMS\Document\Document;
+use VDM\Component\Componentbuilder\Administrator\Helper\HeaderCheck;
+use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
+use VDM\Joomla\Utilities\StringHelper;
+
+// No direct access to this file
+\defined('_JEXEC') or die;
+
+/**
+ * Componentbuilder Html View class for the Initialization_selection
+ *
+ * @since 1.6
+ */
+#[\AllowDynamicProperties]
+class HtmlView extends BaseHtmlView
+{
+ /**
+ * Display the view
+ *
+ * @param string $tpl The name of the template file to parse; automatically searches through the template paths.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 1.6
+ */
+ public function display($tpl = null): void
+ {
+ // get component params
+ $this->params = ComponentHelper::getParams('com_componentbuilder');
+ // get the application
+ $this->app ??= Factory::getApplication();
+ // get the user object
+ $this->user ??= Factory::getApplication()->getIdentity();
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('initialization_selection');
+ $this->styles = $this->get('Styles');
+ $this->scripts = $this->get('Scripts');
+ // Initialise variables.
+ $this->item = $this->get('Item');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ // add the tool bar
+ $this->addToolBar();
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new \Exception(implode(PHP_EOL, $errors), 500);
+ }
+
+ // Set the html view document stuff
+ $this->_prepareDocument();
+
+ parent::display($tpl);
+ }
+
+ /**
+ * Prepare some document related stuff.
+ *
+ * @return void
+ * @since 1.6
+ */
+ protected function _prepareDocument(): void
+ {
+
+ // Only load jQuery if needed. (default is true)
+ if ($this->params->get('add_jquery_framework', 1) == 1)
+ {
+ Html::_('jquery.framework');
+ }
+ // Load the header checker class.
+ // Initialize the header checker.
+ $HeaderCheck = new HeaderCheck();
+
+ // always load these files.
+ Html::_('stylesheet', "media/com_componentbuilder/uikit-v3/css/uikit.min.css", ['version' => 'auto']);
+ Html::_('script', "media/com_componentbuilder/uikit-v3/js/uikit.min.js", ['version' => 'auto']);
+ Html::_('script', "media/com_componentbuilder/uikit-v3/js/uikit-icons.min.js", ['version' => 'auto']);
+ Html::_('script', "media/com_componentbuilder/uikit-v3/js/Uploader.min.js", ['version' => 'auto']);
+
+ // always load these files.
+ Html::_('stylesheet', "media/com_componentbuilder/datatable-bootstrap5/css/datatables.min.css", ['version' => 'auto']);
+ Html::_('script', "media/com_componentbuilder/datatable-bootstrap5/js/pdfmake.min.js", ['version' => 'auto']);
+ Html::_('script', "media/com_componentbuilder/datatable-bootstrap5/js/vfs_fonts.js", ['version' => 'auto']);
+ Html::_('script', "media/com_componentbuilder/datatable-bootstrap5/js/datatables.min.js", ['version' => 'auto']);
+
+ // Add View JavaScript File
+ Html::_('script', "administrator/components/com_componentbuilder/assets/js/initialization_selection.js", ['version' => 'auto']);
+
+ // Load uikit options.
+ $uikit = $this->params->get('uikit_load');
+ // Set script size.
+ $size = $this->params->get('uikit_min');
+ // Set css style.
+ $style = $this->params->get('uikit_style');
+
+ // The uikit css.
+ if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
+ {
+ Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']);
+ }
+ // The uikit js.
+ if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
+ {
+ Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
+ }
+ // set some language strings for the JS class: [InitializationManager]
+ Text::script("COM_COMPONENTBUILDER_MISSING_REPOSITORY_OR_AREA_DATA");
+ Text::script("COM_COMPONENTBUILDER_FAILED_TO_RETRIEVE_REPOSITORY_INDEX");
+ Text::script("COM_COMPONENTBUILDER_NETWORK_OR_SERVER_ERROR_OCCURRED_WHILE_FETCHING_INDEX");
+ Text::script("COM_COMPONENTBUILDER_NO_ITEMS_SELECTED");
+ Text::script("COM_COMPONENTBUILDER_FAILED_TO_INITIALIZE_SELECTED_POWERS");
+ Text::script("COM_COMPONENTBUILDER_ERROR_OCCURRED_WHILE_INITIALIZING_POWERS");
+ Text::script('COM_COMPONENTBUILDER_THESE_ITEMS_WERE_ALREADY_PRESENT_LOCALLY_AND_WERE_NOT_INITIALIZED');
+ Text::script('COM_COMPONENTBUILDER_THESE_ITEMS_COULD_NOT_BE_FOUND_IN_THE_REMOTE_REPOSITORY_AND_WERE_NOT_INITIALIZED');
+ Text::script('COM_COMPONENTBUILDER_THESE_ITEMS_WERE_SUCCESSFULLY_INITIALIZED');
+ // add styles
+ foreach ($this->styles as $style)
+ {
+ Html::_('stylesheet', $style, ['version' => 'auto']);
+ }
+ // add scripts
+ foreach ($this->scripts as $script)
+ {
+ Html::_('script', $script, ['version' => 'auto']);
+ }
+ }
+
+ /**
+ * Add the page title and toolbar.
+ *
+ * @return void
+ * @since 1.6
+ */
+ protected function addToolbar(): void
+ {
+ // hide the main menu
+ $this->app->input->set('hidemainmenu', true);
+ // set the title
+ if (isset($this->item->name) && $this->item->name)
+ {
+ $title = $this->item->name;
+ }
+ // Check for empty title and add view name if param is set
+ if (empty($title))
+ {
+ $title = Text::_('COM_COMPONENTBUILDER_INITIALIZATION_SELECTION');
+ }
+ // add title to the page
+ ToolbarHelper::title($title,'puzzle');
+ // add cpanel button
+ ToolbarHelper::custom('initialization_selection.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false);
+
+ // set help url for this view if found
+ $this->help_url = ComponentbuilderHelper::getHelpUrl('initialization_selection');
+ if (StringHelper::check($this->help_url))
+ {
+ ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ ToolbarHelper::preferences('com_componentbuilder');
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ * @param bool $shorten The switch to shorten.
+ * @param int $length The shorting length.
+ *
+ * @return mixed The escaped value.
+ * @since 1.6
+ */
+ public function escape($var, bool $shorten = false, int $length = 40)
+ {
+ if (!is_string($var))
+ {
+ return $var;
+ }
+
+ return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
+ }
+}
diff --git a/admin/src/View/Get_snippets/index.html b/admin/src/View/Initialization_selection/index.html
similarity index 100%
rename from admin/src/View/Get_snippets/index.html
rename to admin/src/View/Initialization_selection/index.html
diff --git a/admin/src/View/Joomla_component/HtmlView.php b/admin/src/View/Joomla_component/HtmlView.php
index 194611756..deece9059 100644
--- a/admin/src/View/Joomla_component/HtmlView.php
+++ b/admin/src/View/Joomla_component/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_component view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_component', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('joomla_component.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('joomla_component.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_component.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('joomla_component.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_component.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('joomla_component.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_component.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_component.create'))
+ {
+ ToolbarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_component.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('joomla_component.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_component.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('joomla_component.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_component.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Joomla_components/HtmlView.php b/admin/src/View/Joomla_components/HtmlView.php
index 114081126..4a37692a3 100644
--- a/admin/src/View/Joomla_components/HtmlView.php
+++ b/admin/src/View/Joomla_components/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -205,6 +223,21 @@ class HtmlView extends BaseHtmlView
// add Clear tmp button.
ToolbarHelper::custom('joomla_components.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false);
}
+ if ($this->user->authorise('joomla_component.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('joomla_components.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('joomla_component.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_components.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('joomla_component.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_components.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_components');
@@ -263,6 +296,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Joomla_module/HtmlView.php b/admin/src/View/Joomla_module/HtmlView.php
index eae2f5039..b8f94b988 100644
--- a/admin/src/View/Joomla_module/HtmlView.php
+++ b/admin/src/View/Joomla_module/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_module view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_module', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('joomla_module.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('joomla_module.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_module.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('joomla_module.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_module.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('joomla_module.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_MODULE_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_MODULE_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('joomla_module.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_module.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_module.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_module.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_module.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_module.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_module.create'))
+ {
+ ToolbarHelper::apply('joomla_module.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_module.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_module.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_module.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_module.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_module.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_module.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('joomla_module.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_module.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('joomla_module.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_module.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('joomla_module.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Joomla_module_files_folders_urls/HtmlView.php b/admin/src/View/Joomla_module_files_folders_urls/HtmlView.php
index 8f9cf7bc5..7ca65028a 100644
--- a/admin/src/View/Joomla_module_files_folders_urls/HtmlView.php
+++ b/admin/src/View/Joomla_module_files_folders_urls/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_module_files_folders_urls view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_module_files_folders_urls', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('joomla_module_files_folders_urls.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_module_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_module_files_folders_urls.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_module_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_module_files_folders_urls.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_module_files_folders_urls.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_module_files_folders_urls.create'))
+ {
+ ToolbarHelper::apply('joomla_module_files_folders_urls.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_module_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_module_files_folders_urls.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_module_files_folders_urls.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_module_files_folders_urls.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_module_files_folders_urls.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_module_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('joomla_module_files_folders_urls.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Joomla_module_updates/HtmlView.php b/admin/src/View/Joomla_module_updates/HtmlView.php
index cb2a30f49..27c53a3fe 100644
--- a/admin/src/View/Joomla_module_updates/HtmlView.php
+++ b/admin/src/View/Joomla_module_updates/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_module_updates view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_module_updates', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('joomla_module_updates.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_module_updates.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_module_updates.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_module_updates.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_module_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_module_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_module_updates.create'))
+ {
+ ToolbarHelper::apply('joomla_module_updates.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_module_updates.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_module_updates.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_module_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_module_updates.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_module_updates.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_module_updates.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('joomla_module_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Joomla_modules/HtmlView.php b/admin/src/View/Joomla_modules/HtmlView.php
index 088176548..73aea973f 100644
--- a/admin/src/View/Joomla_modules/HtmlView.php
+++ b/admin/src/View/Joomla_modules/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('joomla_modules.trash');
}
}
+ if ($this->user->authorise('joomla_module.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('joomla_modules.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('joomla_module.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_modules.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('joomla_module.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_modules.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Joomla_modules_files_folders_urls/HtmlView.php b/admin/src/View/Joomla_modules_files_folders_urls/HtmlView.php
index 12dd6f19c..c261b7bca 100644
--- a/admin/src/View/Joomla_modules_files_folders_urls/HtmlView.php
+++ b/admin/src/View/Joomla_modules_files_folders_urls/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Joomla_modules_updates/HtmlView.php b/admin/src/View/Joomla_modules_updates/HtmlView.php
index 4daaf2534..b6c23e87f 100644
--- a/admin/src/View/Joomla_modules_updates/HtmlView.php
+++ b/admin/src/View/Joomla_modules_updates/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Joomla_plugin/HtmlView.php b/admin/src/View/Joomla_plugin/HtmlView.php
index ce9110def..2359bf9e2 100644
--- a/admin/src/View/Joomla_plugin/HtmlView.php
+++ b/admin/src/View/Joomla_plugin/HtmlView.php
@@ -27,6 +27,7 @@ use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -47,6 +48,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -119,6 +128,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_plugin view display method
*
@@ -142,10 +159,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_plugin', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -166,7 +183,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -181,17 +207,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -256,6 +282,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('joomla_plugin.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('joomla_plugin.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_plugin.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('joomla_plugin.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_plugin.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -269,6 +305,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('joomla_plugin.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_plugin.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_plugin.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_plugin.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_plugin.create'))
+ {
+ ToolbarHelper::apply('joomla_plugin.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_plugin.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_plugin.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_plugin.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_plugin.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_plugin.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('joomla_plugin.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_plugin.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('joomla_plugin.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_plugin.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
@@ -372,7 +483,7 @@ class HtmlView extends BaseHtmlView
$this->getDocument()->addScriptDeclaration("var expire = ". (int) $expire.";");
$this->getDocument()->addScriptDeclaration("selectionArray = {'property':{},'method':{}};");
// add a few field options via PHP
- FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+ FormHelper::addFieldPath(JPATH_BASE . '/components/com_componentbuilder/models/fields');
$tmp_ = FormHelper::loadFieldType('joomlaplugingroups')->options;
if (ArrayHelper::check($tmp_))
{
diff --git a/admin/src/View/Joomla_plugin_files_folders_urls/HtmlView.php b/admin/src/View/Joomla_plugin_files_folders_urls/HtmlView.php
index 60725552b..25638036b 100644
--- a/admin/src/View/Joomla_plugin_files_folders_urls/HtmlView.php
+++ b/admin/src/View/Joomla_plugin_files_folders_urls/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_plugin_files_folders_urls view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_plugin_files_folders_urls', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('joomla_plugin_files_folders_urls.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_plugin_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_plugin_files_folders_urls.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_plugin_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_plugin_files_folders_urls.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_plugin_files_folders_urls.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_plugin_files_folders_urls.create'))
+ {
+ ToolbarHelper::apply('joomla_plugin_files_folders_urls.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_plugin_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_plugin_files_folders_urls.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_plugin_files_folders_urls.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_plugin_files_folders_urls.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_plugin_files_folders_urls.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_plugin_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('joomla_plugin_files_folders_urls.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Joomla_plugin_group/HtmlView.php b/admin/src/View/Joomla_plugin_group/HtmlView.php
index 02bf674d9..92a628614 100644
--- a/admin/src/View/Joomla_plugin_group/HtmlView.php
+++ b/admin/src/View/Joomla_plugin_group/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_plugin_group view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_plugin_group', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('core.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_plugin_group.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('core.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_plugin_group.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_plugin_group.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_plugin_group.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('core.create'))
+ {
+ ToolbarHelper::apply('joomla_plugin_group.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_plugin_group.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_plugin_group.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_plugin_group.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('core.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_plugin_group.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_plugin_group.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('joomla_plugin_group.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Joomla_plugin_groups/HtmlView.php b/admin/src/View/Joomla_plugin_groups/HtmlView.php
index 6e986ae11..4267bf576 100644
--- a/admin/src/View/Joomla_plugin_groups/HtmlView.php
+++ b/admin/src/View/Joomla_plugin_groups/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Joomla_plugin_updates/HtmlView.php b/admin/src/View/Joomla_plugin_updates/HtmlView.php
index c3900d0ca..c3d3d0bd5 100644
--- a/admin/src/View/Joomla_plugin_updates/HtmlView.php
+++ b/admin/src/View/Joomla_plugin_updates/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_plugin_updates view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_plugin_updates', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('joomla_plugin_updates.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_plugin_updates.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_plugin_updates.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_plugin_updates.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_plugin_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_plugin_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_plugin_updates.create'))
+ {
+ ToolbarHelper::apply('joomla_plugin_updates.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_plugin_updates.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_plugin_updates.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_plugin_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_plugin_updates.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_plugin_updates.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_plugin_updates.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('joomla_plugin_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Joomla_plugins/HtmlView.php b/admin/src/View/Joomla_plugins/HtmlView.php
index 72af49ff3..4a8baa3b5 100644
--- a/admin/src/View/Joomla_plugins/HtmlView.php
+++ b/admin/src/View/Joomla_plugins/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,20 +218,20 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('joomla_plugins.trash');
}
}
- if ($this->user->authorise('joomla_plugin.get_boilerplate', 'com_componentbuilder'))
+ if ($this->user->authorise('joomla_plugin.init', 'com_componentbuilder'))
{
- // add Get Boilerplate button.
- ToolbarHelper::custom('joomla_plugins.getBoilerplate', 'joomla custom-button-getboilerplate', '', 'COM_COMPONENTBUILDER_GET_BOILERPLATE', false);
+ // add Init button.
+ ToolbarHelper::custom('joomla_plugins.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
}
- if ($this->user->authorise('joomla_plugin.methods', 'com_componentbuilder'))
+ if ($this->user->authorise('joomla_plugin.reset', 'com_componentbuilder'))
{
- // add Methods button.
- ToolbarHelper::custom('joomla_plugins.openClassMethods', 'joomla custom-button-openclassmethods', '', 'COM_COMPONENTBUILDER_METHODS', false);
+ // add Reset button.
+ ToolbarHelper::custom('joomla_plugins.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
}
- if ($this->user->authorise('joomla_plugin.properties', 'com_componentbuilder'))
+ if ($this->user->authorise('joomla_plugin.push', 'com_componentbuilder'))
{
- // add Properties button.
- ToolbarHelper::custom('joomla_plugins.openClassProperties', 'joomla custom-button-openclassproperties', '', 'COM_COMPONENTBUILDER_PROPERTIES', false);
+ // add Push button.
+ ToolbarHelper::custom('joomla_plugins.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -273,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Joomla_plugins_files_folders_urls/HtmlView.php b/admin/src/View/Joomla_plugins_files_folders_urls/HtmlView.php
index 0c3d6a308..2a57f81a0 100644
--- a/admin/src/View/Joomla_plugins_files_folders_urls/HtmlView.php
+++ b/admin/src/View/Joomla_plugins_files_folders_urls/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Joomla_plugins_updates/HtmlView.php b/admin/src/View/Joomla_plugins_updates/HtmlView.php
index 1b3ea8113..9e940020b 100644
--- a/admin/src/View/Joomla_plugins_updates/HtmlView.php
+++ b/admin/src/View/Joomla_plugins_updates/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Joomla_power/HtmlView.php b/admin/src/View/Joomla_power/HtmlView.php
index 875d25775..8b7f0da30 100644
--- a/admin/src/View/Joomla_power/HtmlView.php
+++ b/admin/src/View/Joomla_power/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Joomla_power view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('joomla_power', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -278,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_POWER_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_POWER_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('joomla_power.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('joomla_power.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_power.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('joomla_power.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('joomla_power.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('joomla_power.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_power.create'))
+ {
+ ToolbarHelper::apply('joomla_power.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_power.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('joomla_power.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('joomla_power.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_power.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('joomla_power.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('joomla_power.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('joomla_power.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('joomla_power.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('joomla_power.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('joomla_power.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('joomla_power.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Joomla_powers/HtmlView.php b/admin/src/View/Joomla_powers/HtmlView.php
index 17633b1bd..f1a94cbf0 100644
--- a/admin/src/View/Joomla_powers/HtmlView.php
+++ b/admin/src/View/Joomla_powers/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -273,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Language/HtmlView.php b/admin/src/View/Language/HtmlView.php
index b8d4032f3..8eda47a00 100644
--- a/admin/src/View/Language/HtmlView.php
+++ b/admin/src/View/Language/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Language view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('language', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LANGUAGE_NEW' : 'COM_COMPONENTBUILDER_LANGUAGE_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('language.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('language.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('language.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('language.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('language.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('language.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('language.create'))
+ {
+ ToolbarHelper::apply('language.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('language.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('language.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('language.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('language.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('language.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('language.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('language.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Language_translation/HtmlView.php b/admin/src/View/Language_translation/HtmlView.php
index 5aa6e9b65..eefa92582 100644
--- a/admin/src/View/Language_translation/HtmlView.php
+++ b/admin/src/View/Language_translation/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Language_translation view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('language_translation', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_NEW' : 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('language_translation.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('language_translation.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('language_translation.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('language_translation.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('language_translation.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('language_translation.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('language_translation.create'))
+ {
+ ToolbarHelper::apply('language_translation.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('language_translation.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('language_translation.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('language_translation.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('language_translation.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('language_translation.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('language_translation.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('language_translation.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Language_translations/HtmlView.php b/admin/src/View/Language_translations/HtmlView.php
index 30ab76831..b646bd6b7 100644
--- a/admin/src/View/Language_translations/HtmlView.php
+++ b/admin/src/View/Language_translations/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Languages/HtmlView.php b/admin/src/View/Languages/HtmlView.php
index 85c7e75e7..35e8fff26 100644
--- a/admin/src/View/Languages/HtmlView.php
+++ b/admin/src/View/Languages/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -263,6 +281,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Layout/HtmlView.php b/admin/src/View/Layout/HtmlView.php
index 00119a845..2645251c2 100644
--- a/admin/src/View/Layout/HtmlView.php
+++ b/admin/src/View/Layout/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Layout view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('layout', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('layout.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('layout.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('layout.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('layout.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('layout.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('core.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('core.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('core.create'))
+ {
+ ToolbarHelper::apply('layout.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('core.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('layout.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('layout.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('layout.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('layout.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('layout.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Layouts/HtmlView.php b/admin/src/View/Layouts/HtmlView.php
index 2dc349d99..298d4f8b4 100644
--- a/admin/src/View/Layouts/HtmlView.php
+++ b/admin/src/View/Layouts/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,10 +218,20 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('layouts.trash');
}
}
- if ($this->user->authorise('layout.get_snippets', 'com_componentbuilder'))
+ if ($this->user->authorise('layout.init', 'com_componentbuilder'))
{
- // add Get Snippets button.
- ToolbarHelper::custom('layouts.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false);
+ // add Init button.
+ ToolbarHelper::custom('layouts.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('layout.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('layouts.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('layout.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('layouts.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -263,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Libraries/HtmlView.php b/admin/src/View/Libraries/HtmlView.php
index 0432d2305..c69ebf156 100644
--- a/admin/src/View/Libraries/HtmlView.php
+++ b/admin/src/View/Libraries/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,10 +218,20 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('libraries.trash');
}
}
- if ($this->user->authorise('library.get_snippets', 'com_componentbuilder'))
+ if ($this->user->authorise('library.init', 'com_componentbuilder'))
{
- // add Get Snippets button.
- ToolbarHelper::custom('libraries.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false);
+ // add Init button.
+ ToolbarHelper::custom('libraries.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('library.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('libraries.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('library.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('libraries.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -263,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Libraries_config/HtmlView.php b/admin/src/View/Libraries_config/HtmlView.php
index adf45fb2d..fd73ee8a8 100644
--- a/admin/src/View/Libraries_config/HtmlView.php
+++ b/admin/src/View/Libraries_config/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Libraries_files_folders_urls/HtmlView.php b/admin/src/View/Libraries_files_folders_urls/HtmlView.php
index f0194d31f..243eeca89 100644
--- a/admin/src/View/Libraries_files_folders_urls/HtmlView.php
+++ b/admin/src/View/Libraries_files_folders_urls/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Library/HtmlView.php b/admin/src/View/Library/HtmlView.php
index 5f3211518..a45a18211 100644
--- a/admin/src/View/Library/HtmlView.php
+++ b/admin/src/View/Library/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Library view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('library', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('library.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('library.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('library.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('library.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('library.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('library.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('library.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('library.create'))
+ {
+ ToolbarHelper::apply('library.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('library.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('library.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('library.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('library.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('library.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('library.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Library_config/HtmlView.php b/admin/src/View/Library_config/HtmlView.php
index dfd13cda5..103aa93e4 100644
--- a/admin/src/View/Library_config/HtmlView.php
+++ b/admin/src/View/Library_config/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Library_config view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('library_config', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_CONFIG_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_CONFIG_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('library_config.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('library_config.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('library_config.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('library_config.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('library_config.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('library_config.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('library_config.create'))
+ {
+ ToolbarHelper::apply('library_config.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('library_config.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('library_config.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('library_config.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('library_config.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('library_config.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('library_config.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('library_config.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Library_files_folders_urls/HtmlView.php b/admin/src/View/Library_files_folders_urls/HtmlView.php
index 5a9136035..f4c794064 100644
--- a/admin/src/View/Library_files_folders_urls/HtmlView.php
+++ b/admin/src/View/Library_files_folders_urls/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Library_files_folders_urls view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('library_files_folders_urls.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('library_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('library_files_folders_urls.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('library_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('library_files_folders_urls.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('library_files_folders_urls.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('library_files_folders_urls.create'))
+ {
+ ToolbarHelper::apply('library_files_folders_urls.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('library_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('library_files_folders_urls.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('library_files_folders_urls.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('library_files_folders_urls.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('library_files_folders_urls.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('library_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('library_files_folders_urls.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Placeholder/HtmlView.php b/admin/src/View/Placeholder/HtmlView.php
index 06636252a..a663883b1 100644
--- a/admin/src/View/Placeholder/HtmlView.php
+++ b/admin/src/View/Placeholder/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Placeholder view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('placeholder', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('placeholder.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('placeholder.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('placeholder.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('placeholder.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('placeholder.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('placeholder.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_PLACEHOLDER_NEW' : 'COM_COMPONENTBUILDER_PLACEHOLDER_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('placeholder.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('placeholder.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('placeholder.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('placeholder.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('placeholder.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('placeholder.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('placeholder.create'))
+ {
+ ToolbarHelper::apply('placeholder.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('placeholder.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('placeholder.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('placeholder.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('placeholder.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('placeholder.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('placeholder.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('placeholder.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('placeholder.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('placeholder.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('placeholder.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('placeholder.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Placeholders/HtmlView.php b/admin/src/View/Placeholders/HtmlView.php
index dbedcd111..2264da40f 100644
--- a/admin/src/View/Placeholders/HtmlView.php
+++ b/admin/src/View/Placeholders/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('placeholders.trash');
}
}
+ if ($this->user->authorise('placeholder.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('placeholders.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('placeholder.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('placeholders.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('placeholder.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('placeholders.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('placeholders');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Power/HtmlView.php b/admin/src/View/Power/HtmlView.php
index 49c5e32ac..f9de19a2b 100644
--- a/admin/src/View/Power/HtmlView.php
+++ b/admin/src/View/Power/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Power view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('power', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -278,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_POWER_NEW' : 'COM_COMPONENTBUILDER_POWER_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('power.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('power.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('power.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('power.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('power.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('power.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('power.create'))
+ {
+ ToolbarHelper::apply('power.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('power.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('power.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('power.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('power.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('power.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('power.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('power.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('power.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('power.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('power.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('power.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Powers/HtmlView.php b/admin/src/View/Powers/HtmlView.php
index f517340b7..b6c5d9bcc 100644
--- a/admin/src/View/Powers/HtmlView.php
+++ b/admin/src/View/Powers/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -273,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Repositories/HtmlView.php b/admin/src/View/Repositories/HtmlView.php
index e702d08af..b913910f5 100644
--- a/admin/src/View/Repositories/HtmlView.php
+++ b/admin/src/View/Repositories/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,6 +218,21 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('repositories.trash');
}
}
+ if ($this->user->authorise('repository.init', 'com_componentbuilder'))
+ {
+ // add Init button.
+ ToolbarHelper::custom('repositories.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('repository.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('repositories.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('repository.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('repositories.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('repositories');
@@ -258,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Repository/HtmlView.php b/admin/src/View/Repository/HtmlView.php
index a61ab5b7f..81d3b1709 100644
--- a/admin/src/View/Repository/HtmlView.php
+++ b/admin/src/View/Repository/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Repository view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('repository', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('repository.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('repository.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('repository.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('repository.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('repository.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('repository.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_REPOSITORY_NEW' : 'COM_COMPONENTBUILDER_REPOSITORY_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('repository.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('repository.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('repository.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('repository.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('repository.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('repository.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('repository.create'))
+ {
+ ToolbarHelper::apply('repository.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('repository.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('repository.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('repository.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('repository.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('repository.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('repository.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('repository.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('repository.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('repository.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('repository.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('repository.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Server/HtmlView.php b/admin/src/View/Server/HtmlView.php
index fef2040b7..b62a3f380 100644
--- a/admin/src/View/Server/HtmlView.php
+++ b/admin/src/View/Server/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Server view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('server', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_SERVER_NEW' : 'COM_COMPONENTBUILDER_SERVER_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('server.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('server.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('server.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('server.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('server.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('server.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('server.create'))
+ {
+ ToolbarHelper::apply('server.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('server.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('server.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('server.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('server.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('server.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('server.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('server.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Servers/HtmlView.php b/admin/src/View/Servers/HtmlView.php
index 8358b8d59..40913556b 100644
--- a/admin/src/View/Servers/HtmlView.php
+++ b/admin/src/View/Servers/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Site_view/HtmlView.php b/admin/src/View/Site_view/HtmlView.php
index 9d0c4cc46..7e62f85f9 100644
--- a/admin/src/View/Site_view/HtmlView.php
+++ b/admin/src/View/Site_view/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Site_view view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('site_view', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('site_view.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('site_view.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('site_view.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('site_view.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('site_view.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('site_view.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_SITE_VIEW_NEW' : 'COM_COMPONENTBUILDER_SITE_VIEW_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('core.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('site_view.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('core.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('site_view.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('site_view.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('site_view.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('core.create'))
+ {
+ ToolbarHelper::apply('site_view.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('site_view.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('site_view.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('site_view.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('core.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('site_view.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('site_view.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('site_view.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('site_view.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('site_view.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('site_view.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('site_view.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Site_views/HtmlView.php b/admin/src/View/Site_views/HtmlView.php
index 3306ef1a0..f9bbfa748 100644
--- a/admin/src/View/Site_views/HtmlView.php
+++ b/admin/src/View/Site_views/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,10 +218,20 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('site_views.trash');
}
}
- if ($this->user->authorise('site_view.get_snippets', 'com_componentbuilder'))
+ if ($this->user->authorise('site_view.init', 'com_componentbuilder'))
{
- // add Get Snippets button.
- ToolbarHelper::custom('site_views.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false);
+ // add Init button.
+ ToolbarHelper::custom('site_views.getSnippets', 'health custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('site_view.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('site_views.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('site_view.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('site_views.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -263,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Snippet/HtmlView.php b/admin/src/View/Snippet/HtmlView.php
index b03de6d2d..47a5466c3 100644
--- a/admin/src/View/Snippet/HtmlView.php
+++ b/admin/src/View/Snippet/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Snippet view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('snippet.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('snippet.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('snippet.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('snippet.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('snippet.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('snippet.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_SNIPPET_NEW' : 'COM_COMPONENTBUILDER_SNIPPET_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('core.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('snippet.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('core.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('snippet.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('snippet.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('snippet.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('core.create'))
+ {
+ ToolbarHelper::apply('snippet.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('snippet.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('snippet.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('snippet.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('core.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('snippet.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('snippet.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('snippet.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('snippet.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('snippet.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('snippet.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('snippet.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Snippet_type/HtmlView.php b/admin/src/View/Snippet_type/HtmlView.php
index 788ad04e4..1cb98f957 100644
--- a/admin/src/View/Snippet_type/HtmlView.php
+++ b/admin/src/View/Snippet_type/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Snippet_type view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet_type', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_SNIPPET_TYPE_NEW' : 'COM_COMPONENTBUILDER_SNIPPET_TYPE_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('snippet_type.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('snippet_type.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('snippet_type.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('snippet_type.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('snippet_type.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('snippet_type.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('snippet_type.create'))
+ {
+ ToolbarHelper::apply('snippet_type.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('snippet_type.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('snippet_type.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('snippet_type.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('snippet_type.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('snippet_type.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('snippet_type.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('snippet_type.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Snippet_types/HtmlView.php b/admin/src/View/Snippet_types/HtmlView.php
index fd132c0f2..49234fa18 100644
--- a/admin/src/View/Snippet_types/HtmlView.php
+++ b/admin/src/View/Snippet_types/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Snippets/HtmlView.php b/admin/src/View/Snippets/HtmlView.php
index 44b827184..222f979be 100644
--- a/admin/src/View/Snippets/HtmlView.php
+++ b/admin/src/View/Snippets/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -190,11 +208,6 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::checkin('snippets.checkin');
}
}
- if ($this->user->authorise('snippet.share_snippets', 'com_componentbuilder'))
- {
- // add Share Snippets button.
- ToolbarHelper::custom('snippets.shareSnippets', 'share custom-button-sharesnippets', '', 'COM_COMPONENTBUILDER_SHARE_SNIPPETS', 'true');
- }
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
@@ -205,10 +218,20 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('snippets.trash');
}
}
- if ($this->user->authorise('snippet.get_snippets', 'com_componentbuilder'))
+ if ($this->user->authorise('snippet.init', 'com_componentbuilder'))
{
- // add Get Snippets button.
- ToolbarHelper::custom('snippets.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false);
+ // add Init button.
+ ToolbarHelper::custom('snippets.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('snippet.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('snippets.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('snippet.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('snippets.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -268,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Template/HtmlView.php b/admin/src/View/Template/HtmlView.php
index 1d5d09270..edbf88ee8 100644
--- a/admin/src/View/Template/HtmlView.php
+++ b/admin/src/View/Template/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Template view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('template', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -255,6 +281,16 @@ class HtmlView extends BaseHtmlView
{
ToolbarHelper::custom('template.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
+ if ($this->canDo->get('template.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('template.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('template.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('template.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
ToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
}
}
@@ -268,6 +304,81 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_TEMPLATE_NEW' : 'COM_COMPONENTBUILDER_TEMPLATE_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('core.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('template.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('core.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('template.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('core.create'))
+ {
+ ToolbarHelper::apply('template.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('template.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('template.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('core.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('template.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('template.save', 'JTOOLBAR_SAVE');
+ }
+ if ($this->canDo->get('template.reset'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('template.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->canDo->get('template.push'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('template.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
+ }
+ ToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Templates/HtmlView.php b/admin/src/View/Templates/HtmlView.php
index ac2b010d1..1001d0900 100644
--- a/admin/src/View/Templates/HtmlView.php
+++ b/admin/src/View/Templates/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -200,10 +218,20 @@ class HtmlView extends BaseHtmlView
ToolbarHelper::trash('templates.trash');
}
}
- if ($this->user->authorise('template.get_snippets', 'com_componentbuilder'))
+ if ($this->user->authorise('template.init', 'com_componentbuilder'))
{
- // add Get Snippets button.
- ToolbarHelper::custom('templates.getSnippets', 'search custom-button-getsnippets', '', 'COM_COMPONENTBUILDER_GET_SNIPPETS', false);
+ // add Init button.
+ ToolbarHelper::custom('templates.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
+ }
+ if ($this->user->authorise('template.reset', 'com_componentbuilder'))
+ {
+ // add Reset button.
+ ToolbarHelper::custom('templates.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
+ }
+ if ($this->user->authorise('template.push', 'com_componentbuilder'))
+ {
+ // add Push button.
+ ToolbarHelper::custom('templates.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
}
// set help url for this view if found
@@ -263,6 +291,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/src/View/Validation_rule/HtmlView.php b/admin/src/View/Validation_rule/HtmlView.php
index 8bf626849..7a9ce8ec2 100644
--- a/admin/src/View/Validation_rule/HtmlView.php
+++ b/admin/src/View/Validation_rule/HtmlView.php
@@ -26,6 +26,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\Document\Document;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
use VDM\Joomla\Utilities\StringHelper;
+use Joomla\Input\Input;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -46,6 +47,14 @@ class HtmlView extends BaseHtmlView
*/
public mixed $item;
+ /**
+ * The input class
+ *
+ * @var Input
+ * @since 5.2.1
+ */
+ public Input $input;
+
/**
* The state object
*
@@ -118,6 +127,14 @@ class HtmlView extends BaseHtmlView
*/
public string $referral;
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* Validation_rule view display method
*
@@ -141,10 +158,10 @@ class HtmlView extends BaseHtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('validation_rule', $this->item);
// get input
- $jinput = Factory::getApplication()->input;
- $this->ref = $jinput->get('ref', 0, 'word');
- $this->refid = $jinput->get('refid', 0, 'int');
- $return = $jinput->get('return', null, 'base64');
+ $this->input ??= Factory::getApplication()->input;
+ $this->ref = $this->input->get('ref', 0, 'word');
+ $this->refid = $this->input->get('refid', 0, 'int');
+ $return = $this->input->get('return', null, 'base64');
// set the referral string
$this->referral = '';
if ($this->refid && $this->ref)
@@ -165,7 +182,16 @@ class HtmlView extends BaseHtmlView
}
// Set the toolbar
- $this->addToolBar();
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->isModal = false;
+ $this->addToolbar();
+ }
+ else
+ {
+ $this->isModal = true;
+ $this->addModalToolbar();
+ }
// Check for errors.
if (count($errors = $this->get('Errors')))
@@ -180,17 +206,17 @@ class HtmlView extends BaseHtmlView
parent::display($tpl);
}
-
/**
* Add the page title and toolbar.
*
* @return void
+ * @throws \Exception
* @since 1.6
*/
protected function addToolbar(): void
{
Factory::getApplication()->input->set('hidemainmenu', true);
- $user = Factory::getApplication()->getIdentity();
+ $user = $this->getCurrentUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
@@ -268,6 +294,71 @@ class HtmlView extends BaseHtmlView
}
}
+ /**
+ * Add the modal toolbar.
+ *
+ * @return void
+ * @throws \Exception
+ * @since 5.0.0
+ */
+ protected function addModalToolbar()
+ {
+ Factory::getApplication()->input->set('hidemainmenu', true);
+ $user = $this->getCurrentUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_VALIDATION_RULE_NEW' : 'COM_COMPONENTBUILDER_VALIDATION_RULE_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (StringHelper::check($this->referral))
+ {
+ if ($this->canDo->get('validation_rule.create') && $isNew)
+ {
+ // We can create the record.
+ ToolbarHelper::save('validation_rule.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('validation_rule.edit'))
+ {
+ // We can save the record.
+ ToolbarHelper::save('validation_rule.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ ToolbarHelper::cancel('validation_rule.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ ToolbarHelper::cancel('validation_rule.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('validation_rule.create'))
+ {
+ ToolbarHelper::apply('validation_rule.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('validation_rule.save', 'JTOOLBAR_SAVE');
+ ToolbarHelper::custom('validation_rule.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ ToolbarHelper::cancel('validation_rule.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('validation_rule.edit'))
+ {
+ // We can save the new record
+ ToolbarHelper::apply('validation_rule.apply', 'JTOOLBAR_APPLY');
+ ToolbarHelper::save('validation_rule.save', 'JTOOLBAR_SAVE');
+ }
+ ToolbarHelper::cancel('validation_rule.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/admin/src/View/Validation_rules/HtmlView.php b/admin/src/View/Validation_rules/HtmlView.php
index 7069f963f..d9948186b 100644
--- a/admin/src/View/Validation_rules/HtmlView.php
+++ b/admin/src/View/Validation_rules/HtmlView.php
@@ -87,6 +87,22 @@ class HtmlView extends BaseHtmlView
*/
public string $return_here;
+ /**
+ * The title key used in modal
+ *
+ * @var string
+ * @since 5.2.1
+ */
+ public string $modalTitleKey;
+
+ /**
+ * The modal state
+ *
+ * @var bool
+ * @since 5.2.1
+ */
+ public bool $isModal;
+
/**
* The user object.
*
@@ -138,8 +154,10 @@ class HtmlView extends BaseHtmlView
}
// We don't need toolbar in the modal window.
+ $this->isModal = true;
if ($this->getLayout() !== 'modal')
{
+ $this->isModal = false;
$this->addToolbar();
}
@@ -258,6 +276,17 @@ class HtmlView extends BaseHtmlView
return StringHelper::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
}
+ /**
+ * Get the modal data/title key
+ *
+ * @return string The key value.
+ * @since 5.2.1
+ */
+ public function getModalTitleKey(): string
+ {
+ return $this->modalTitleKey ?? 'id';
+ }
+
/**
* Returns an array of fields the table can be sorted by
*
diff --git a/admin/tmpl/admin_custom_tabs/default.php b/admin/tmpl/admin_custom_tabs/default.php
index 98c9043e0..7955fb742 100644
--- a/admin/tmpl/admin_custom_tabs/default.php
+++ b/admin/tmpl/admin_custom_tabs/default.php
@@ -24,13 +24,16 @@ Html::_('bootstrap.tooltip');
// No direct access to this file
defined('_JEXEC') or die;
+$layout = $this->isModal ? 'modal' : 'edit';
+$tmpl = $this->input->get('tmpl');
+$tmpl = $tmpl ? '&tmpl=' . $tmpl : '';
?>