29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-25 23:02:55 +00:00

Fix merge conflicts

This commit is contained in:
C-Lodder 2017-01-12 14:52:30 +00:00
commit c09475d0ca
No known key found for this signature in database
GPG Key ID: B80FEA68238B1EA7
837 changed files with 23173 additions and 22859 deletions

2
.gitignore vendored
View File

@ -64,6 +64,7 @@ Desktop.ini
/libraries/vendor/ircmaxell/password-compat/phpunit.xml.dist
/libraries/vendor/ircmaxell/password-compat/README.md
/libraries/vendor/ircmaxell/password-compat/version-test.php
/libraries/vendor/joomla/*/.github
/libraries/vendor/joomla/*/.gitignore
/libraries/vendor/joomla/*/.gitmodules
/libraries/vendor/joomla/*/docs
@ -74,6 +75,7 @@ Desktop.ini
/libraries/vendor/joomla/*/composer.json
/libraries/vendor/joomla/*/phpunit.xml.dist
/libraries/vendor/joomla/*/README.md
/libraries/vendor/joomla/session/Joomla/Session/.github
/libraries/vendor/joomla/session/Joomla/Session/_Tests
/libraries/vendor/joomla/session/Joomla/Session/build
/libraries/vendor/joomla/session/Joomla/Session/Tests

View File

@ -313,7 +313,7 @@ class AdminModelSysInfo extends JModelLegacy
'sapi_name' => php_sapi_name(),
'version' => $version->getLongVersion(),
'platform' => $platform->getLongVersion(),
'useragent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "",
'useragent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
);
return $this->info;

View File

@ -28,7 +28,7 @@ function admin_postinstall_languageaccess340_condition()
$query = $db->getQuery(true)
->select($db->quoteName('access'))
->from($db->quoteName('#__languages'))
->where($db->quoteName('access') . " = " . $db->quote('0'));
->where($db->quoteName('access') . ' = ' . $db->quote('0'));
$db->setQuery($query);
$db->execute();
$numRows = $db->getNumRows();

View File

@ -112,9 +112,7 @@ class JoomlaInstallerScript
*/
protected function updateDatabase()
{
$db = JFactory::getDbo();
if (strpos($db->name, 'mysql') !== false)
if (JFactory::getDbo()->getServerType() === 'mysql')
{
$this->updateDatabaseMysql();
}
@ -208,7 +206,7 @@ class JoomlaInstallerScript
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function removeJedUpdateserver()
{
@ -225,14 +223,14 @@ class JoomlaInstallerScript
)->loadResult();
// Delete from update sites
$result = $db->setQuery(
$db->setQuery(
$db->getQuery(true)
->delete($db->quoteName('#__update_sites'))
->where($db->quoteName('update_site_id') . ' = ' . $id)
)->execute();
// Delete from update sites extensions
$result = $db->setQuery(
$db->setQuery(
$db->getQuery(true)
->delete($db->quoteName('#__update_sites_extensions'))
->where($db->quoteName('update_site_id') . ' = ' . $id)
@ -395,7 +393,22 @@ class JoomlaInstallerScript
array('plugin', 'menu', 'editors-xtd', 0),
array('plugin', 'contact', 'editors-xtd', 0),
array('plugin', 'fields', 'system', 0),
array('plugin', 'calendar', 'fields', 0),
array('plugin', 'checkboxes', 'fields', 0),
array('plugin', 'color', 'fields', 0),
array('plugin', 'editor', 'fields', 0),
array('plugin', 'gallery', 'fields', 0),
array('plugin', 'imagelist', 'fields', 0),
array('plugin', 'integer', 'fields', 0),
array('plugin', 'list', 'fields', 0),
array('plugin', 'media', 'fields', 0),
array('plugin', 'radio', 'fields', 0),
array('plugin', 'sql', 'fields', 0),
array('plugin', 'text', 'fields', 0),
array('plugin', 'textarea', 'fields', 0),
array('plugin', 'url', 'fields', 0),
array('plugin', 'user', 'fields', 0),
array('plugin', 'usergrouplist', 'fields', 0),
// Templates
array('template', 'protostar', '', 0),
@ -1549,7 +1562,7 @@ class JoomlaInstallerScript
// Joomla! 3.6.3
'/media/editors/codemirror/mode/jade/jade.js',
'/media/editors/codemirror/mode/jade/jade.min.js',
// Joomla __DEPLOY_VERSION__
// Joomla 3.7.0
'/libraries/joomla/user/authentication.php',
'/libraries/platform.php',
'/libraries/joomla/data/data.php',
@ -1600,6 +1613,16 @@ class JoomlaInstallerScript
'/media/jui/css/bootstrap-tooltip-extended.css',
'/media/jui/css/bootstrap-responsive.css',
'/media/jui/css/bootstrap-responsive.min.css',
'/administrator/components/com_cache/layouts/joomla/searchtools/default/bar.php',
'/administrator/components/com_cache/layouts/joomla/searchtools/default.php',
'/administrator/components/com_languages/layouts/joomla/searchtools/default/bar.php',
'/administrator/components/com_languages/layouts/joomla/searchtools/default.php',
'/administrator/components/com_menus/layouts/joomla/searchtools/default/bar.php',
'/administrator/components/com_menus/layouts/joomla/searchtools/default.php',
'/administrator/components/com_modules/layouts/joomla/searchtools/default/bar.php',
'/administrator/components/com_modules/layouts/joomla/searchtools/default.php',
'/administrator/components/com_templates/layouts/joomla/searchtools/default/bar.php',
'/administrator/components/com_templates/layouts/joomla/searchtools/default.php',
);
// TODO There is an issue while deleting folders using the ftp mode
@ -1709,12 +1732,29 @@ class JoomlaInstallerScript
'/libraries/simplepie',
// Joomla! 3.6.3
'/media/editors/codemirror/mode/jade',
// Joomla! __DEPLOY_VERSION__
// Joomla! 3.7.0
'/libraries/joomla/data',
'/templates/beez3',
'/administrator/templates/isis',
'/administrator/templates/hathor',
'/media/jui/less',
'/administrator/components/com_cache/layouts/joomla/searchtools/default',
'/administrator/components/com_cache/layouts/joomla/searchtools',
'/administrator/components/com_cache/layouts/joomla',
'/administrator/components/com_cache/layouts',
'/administrator/components/com_languages/layouts/joomla/searchtools/default',
'/administrator/components/com_languages/layouts/joomla/searchtools',
'/administrator/components/com_languages/layouts/joomla',
'/administrator/components/com_languages/layouts',
'/administrator/components/com_menus/layouts/joomla/searchtools/default',
'/administrator/components/com_menus/layouts/joomla/searchtools',
'/administrator/components/com_modules/layouts/joomla/searchtools/default',
'/administrator/components/com_modules/layouts/joomla/searchtools',
'/administrator/components/com_modules/layouts/joomla',
'/administrator/components/com_templates/layouts/joomla/searchtools/default',
'/administrator/components/com_templates/layouts/joomla/searchtools',
'/administrator/components/com_templates/layouts/joomla',
'/administrator/components/com_templates/layouts',
);
jimport('joomla.filesystem.file');
@ -1850,12 +1890,10 @@ class JoomlaInstallerScript
try
{
switch ($db->name)
switch ($db->getServerType())
{
// MySQL database, use TRUNCATE (faster, more resilient)
case 'pdomysql':
case 'mysql':
case 'mysqli':
$db->truncateTable('#__session');
break;
@ -1938,7 +1976,7 @@ class JoomlaInstallerScript
}
// Step 1: Drop indexes later to be added again with column lengths limitations at step 2
$fileName1 = JPATH_ROOT . "/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql";
$fileName1 = JPATH_ROOT . '/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql';
if (is_file($fileName1))
{
@ -1962,7 +2000,7 @@ class JoomlaInstallerScript
}
// Step 2: Perform the index modifications and conversions
$fileName2 = JPATH_ROOT . "/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql";
$fileName2 = JPATH_ROOT . '/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql';
if (is_file($fileName2))
{

View File

@ -1 +1 @@
ALTER TABLE `#__updates` ADD COLUMN `infourl` text NOT NULL AFTER `detailsurl`;
ALTER TABLE `#__updates` ADD COLUMN `infourl` text NOT NULL AFTER `detailsurl`;

View File

@ -82,6 +82,20 @@ CREATE TABLE IF NOT EXISTS `#__fields_values` (
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
(33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
(461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
(462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
(461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(462, 'plg_fields_calendar', 'plugin', 'calendar', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(463, 'plg_fields_checkboxes', 'plugin', 'checkboxes', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(464, 'plg_fields_color', 'plugin', 'color', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(465, 'plg_fields_editor', 'plugin', 'editor', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(466, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(467, 'plg_fields_imagelist', 'plugin', 'imagelist', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(468, 'plg_fields_integer', 'plugin', 'integer', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(469, 'plg_fields_list', 'plugin', 'list', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(470, 'plg_fields_media', 'plugin', 'media', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(471, 'plg_fields_radio', 'plugin', 'radio', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(472, 'plg_fields_sql', 'plugin', 'sql', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(473, 'plg_fields_text', 'plugin', 'text', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(474, 'plg_fields_textarea', 'plugin', 'textarea', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(475, 'plg_fields_url', 'plugin', 'url', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(476, 'plg_fields_user', 'plugin', 'user', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(477, 'plg_fields_usergrouplist', 'plugin', 'usergrouplist', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);

View File

@ -0,0 +1,18 @@
-- Normalize ucm_content_table default values.
ALTER TABLE `#__ucm_content` MODIFY `core_title` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_body` mediumtext NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_checked_out_time` varchar(255) NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__ucm_content` MODIFY `core_params` text NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_metadata` varchar(2048) NOT NULL DEFAULT '' COMMENT 'JSON encoded metadata properties.';
ALTER TABLE `#__ucm_content` MODIFY `core_language` char(7) NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__ucm_content` MODIFY `core_publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `#__ucm_content` MODIFY `core_content_item_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'ID from the individual type table';
ALTER TABLE `#__ucm_content` MODIFY `asset_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.';
ALTER TABLE `#__ucm_content` MODIFY `core_images` text NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_urls` text NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_metakey` text NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_metadesc` text NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_xreference` varchar(50) NOT NULL DEFAULT '' COMMENT 'A reference to enable linkages to external data sets.';
ALTER TABLE `#__ucm_content` MODIFY `core_type_id` int(10) unsigned NOT NULL DEFAULT 0;

View File

@ -0,0 +1,8 @@
-- Normalize categories table default values.
ALTER TABLE `#__categories` MODIFY `title` varchar(255) NOT NULL DEFAULT '';
ALTER TABLE `#__categories` MODIFY `description` mediumtext NOT NULL DEFAULT '';
ALTER TABLE `#__categories` MODIFY `params` text NOT NULL DEFAULT '';
ALTER TABLE `#__categories` MODIFY `metadesc` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The meta description for the page.';
ALTER TABLE `#__categories` MODIFY `metakey` varchar(1024) NOT NULL DEFAULT '' COMMENT 'The meta keywords for the page.';
ALTER TABLE `#__categories` MODIFY `metadata` varchar(2048) NOT NULL DEFAULT '' COMMENT 'JSON encoded metadata properties.';
ALTER TABLE `#__categories` MODIFY `language` char(7) NOT NULL DEFAULT '';

View File

@ -94,5 +94,20 @@ CREATE INDEX "#__fields_values_idx_item_id" ON "#__fields_values" ("item_id");
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
(33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
(462, 'plg_fields_calendar', 'plugin', 'calendar', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(463, 'plg_fields_checkboxes', 'plugin', 'checkboxes', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(464, 'plg_fields_color', 'plugin', 'color', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(465, 'plg_fields_editor', 'plugin', 'editor', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(466, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(467, 'plg_fields_imagelist', 'plugin', 'imagelist', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(468, 'plg_fields_integer', 'plugin', 'integer', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(469, 'plg_fields_list', 'plugin', 'list', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(470, 'plg_fields_media', 'plugin', 'media', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(471, 'plg_fields_radio', 'plugin', 'radio', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(472, 'plg_fields_sql', 'plugin', 'sql', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(473, 'plg_fields_text', 'plugin', 'text', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(474, 'plg_fields_textarea', 'plugin', 'textarea', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(475, 'plg_fields_url', 'plugin', 'url', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(476, 'plg_fields_user', 'plugin', 'user', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),
(477, 'plg_fields_usergrouplist', 'plugin', 'usergrouplist', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);

View File

@ -1,2 +1 @@
ALTER TABLE "#__session" ALTER COLUMN "client_id" DROP NOT NULL;
ALTER TABLE "#__session" ALTER COLUMN "client_id" SET DEFAULT NULL;

View File

@ -0,0 +1,9 @@
-- Normalize ucm_content_table default values.
ALTER TABLE "#__ucm_content" ALTER COLUMN "core_title" SET DEFAULT '';
ALTER TABLE "#__ucm_content" ALTER COLUMN "core_body" SET DEFAULT '';
ALTER TABLE "#__ucm_content" ALTER COLUMN "core_params" SET DEFAULT '';
ALTER TABLE "#__ucm_content" ALTER COLUMN "core_metadata" SET DEFAULT '';
ALTER TABLE "#__ucm_content" ALTER COLUMN "core_images" SET DEFAULT '';
ALTER TABLE "#__ucm_content" ALTER COLUMN "core_urls" SET DEFAULT '';
ALTER TABLE "#__ucm_content" ALTER COLUMN "core_metakey" SET DEFAULT '';
ALTER TABLE "#__ucm_content" ALTER COLUMN "core_metadesc" SET DEFAULT '';

View File

@ -0,0 +1,6 @@
-- Normalize categories table default values.
ALTER TABLE "#__categories" ALTER COLUMN "title" SET DEFAULT '';
ALTER TABLE "#__categories" ALTER COLUMN "params" SET DEFAULT '';
ALTER TABLE "#__categories" ALTER COLUMN "metadesc" SET DEFAULT '';
ALTER TABLE "#__categories" ALTER COLUMN "metakey" SET DEFAULT '';
ALTER TABLE "#__categories" ALTER COLUMN "metadata" SET DEFAULT '';

View File

@ -0,0 +1,155 @@
/****** Object:  Table [#__fields] ******/
SET QUOTED_IDENTIFIER ON;
CREATE TABLE [#__fields] (
[id] [int] IDENTITY(1,1) NOT NULL,
[asset_id] [int] NOT NULL DEFAULT 0,
[context] [nvarchar](255) NOT NULL DEFAULT '',
[group_id] [int] NOT NULL DEFAULT 0,
[title] [nvarchar](255) NOT NULL DEFAULT '',
[alias] [nvarchar](255) NOT NULL DEFAULT '',
[label] [nvarchar](255) NOT NULL DEFAULT '',
[default_value] [nvarchar](max) NOT NULL DEFAULT '',
[type] [nvarchar](255) NOT NULL DEFAULT '',
[options] [nvarchar](255) NOT NULL DEFAULT '',
[note] [nvarchar](255) NOT NULL DEFAULT '',
[description] [nvarchar](max) NOT NULL DEFAULT '',
[state] [smallint] NOT NULL DEFAULT 0,
[required] [smallint] NOT NULL DEFAULT 0,
[checked_out] [bigint] NOT NULL DEFAULT 0,
[checked_out_time] [datetime] NOT NULL DEFAULT '1900-01-01 00:00:00',
[ordering] [int] NOT NULL DEFAULT 0,
[params] [nvarchar](max) NOT NULL DEFAULT '',
[fieldparams] [nvarchar](max) NOT NULL DEFAULT '',
[attributes] [nvarchar](max) NOT NULL DEFAULT '',
[language] [nvarchar](7) NOT NULL DEFAULT '',
[created_time] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[created_user_id] [bigint] NOT NULL DEFAULT 0,
[created_by_alias] [nvarchar](255) NOT NULL DEFAULT '',
[modified_time] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[modified_by] [bigint] NOT NULL DEFAULT 0,
[publish_up] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[publish_down] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[access] [int] NOT NULL DEFAULT 1,
CONSTRAINT [PK_#__fields_id] PRIMARY KEY CLUSTERED(
[id] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON
) ON [PRIMARY]) ON [PRIMARY];
CREATE NONCLUSTERED INDEX [idx_checkout] ON [#__fields](
[checked_out] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_state] ON [#__fields](
[state] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_access] ON [#__fields](
[access] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_context] ON [#__fields](
[context] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_language] ON [#__fields](
[language] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
/****** Object:  Table [#__fields_categories] ******/
SET QUOTED_IDENTIFIER ON;
CREATE TABLE [#__fields_categories] ( 
[field_id] [int] NOT NULL DEFAULT 0,   
[category_id] [int] NOT NULL DEFAULT 0,   
CONSTRAINT [PK_#__fields_categories_id] PRIMARY KEY CLUSTERED(
[field_id] ASC, 
[category_id] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON
) ON [PRIMARY]) ON [PRIMARY];
/****** Object: Table [#__fields_groups] ******/
SET QUOTED_IDENTIFIER ON;
CREATE TABLE [#__fields_groups] (
[id] [int] IDENTITY(1,1) NOT NULL,
[asset_id] [int] NOT NULL DEFAULT 0,
[context] [nvarchar](255) NOT NULL DEFAULT '',
[title] [nvarchar](255) NOT NULL DEFAULT '',
[note] [nvarchar](255) NOT NULL DEFAULT '',
[description] [nvarchar](max) NOT NULL DEFAULT '',
[state] [smallint] NOT NULL DEFAULT 0,
[checked_out] [bigint] NOT NULL DEFAULT 0,
[checked_out_time] [datetime] NOT NULL DEFAULT '1900-01-01 00:00:00',
[ordering] [int] NOT NULL DEFAULT 0,
[language] [nvarchar](7) NOT NULL DEFAULT '',
[created] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[created_by] [bigint] NOT NULL DEFAULT 0,
[modified] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000',
[modified_by] [bigint] NOT NULL DEFAULT 0,
[access] [int] NOT NULL DEFAULT 1,
CONSTRAINT [PK_#__fields_groups_id] PRIMARY KEY CLUSTERED(
[id] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON
) ON [PRIMARY]) ON [PRIMARY];
CREATE NONCLUSTERED INDEX [idx_checkout] ON [#__fields_groups](
[checked_out] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_state] ON [#__fields_groups](
[state] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_created_by] ON [#__fields_groups](
[created_by] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_access] ON [#__fields_groups](
[access] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_context] ON [#__fields_groups](
[context] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_language] ON [#__fields_groups](
[language] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
/****** Object:  Table [#__fields_values] ******/
SET QUOTED_IDENTIFIER ON;
CREATE TABLE [#__fields_values] (
[field_id] [bigint] NOT NULL DEFAULT 1,
[context] [nvarchar](255) NOT NULL DEFAULT '',
[item_id] [nvarchar](255) NOT NULL DEFAULT '',
[value] [nvarchar](max) NOT NULL DEFAULT '',
) ON [PRIMARY];
CREATE NONCLUSTERED INDEX [idx_field_id] ON [#__fields_values](
[field_id] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_context] ON [#__fields_values](
[context] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
CREATE NONCLUSTERED INDEX [idx_item_id] ON [#__fields_values](
[item_id] ASC)
WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF);
SET IDENTITY_INSERT [#__extensions] ON;
INSERT INTO [#__extensions] ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state])
SELECT 33, 'com_fields', 'component', 'com_fields', '', 1, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 461, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0
UNION ALL
SELECT 462, 'plg_fields_gallery', 'plugin', 'gallery', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0;
SET IDENTITY_INSERT [#__extensions] OFF;

View File

@ -0,0 +1,14 @@
-- Normalize ucm_content_table default values.
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_type_alias] [nvarchar](255) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_body] [nvarchar](max) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_params] [nvarchar](max) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_metadata] [nvarchar](2048) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_language] [nvarchar](7) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_content_item_id] [bigint] NOT NULL DEFAULT 0;
ALTER TABLE [#__ucm_content] ALTER COLUMN [asset_id] [bigint] NOT NULL DEFAULT 0;
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_images] [nvarchar](max) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_urls] [nvarchar](max) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_metakey] [nvarchar](max) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_metadesc] [nvarchar](max) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_xreference] [nvarchar](50) NOT NULL DEFAULT '';
ALTER TABLE [#__ucm_content] ALTER COLUMN [core_type_id] [bigint] NOT NULL DEFAULT 0;

View File

@ -0,0 +1,8 @@
-- Normalize categories table default values.
ALTER TABLE [#__categories] ALTER COLUMN [title] [nvarchar](255) NOT NULL DEFAULT '';
ALTER TABLE [#__categories] ALTER COLUMN [description] [nvarchar](max) NOT NULL DEFAULT '';
ALTER TABLE [#__categories] ALTER COLUMN [params] [nvarchar](max) NOT NULL DEFAULT '';
ALTER TABLE [#__categories] ALTER COLUMN [metadesc] [nvarchar](1024) NOT NULL DEFAULT '';
ALTER TABLE [#__categories] ALTER COLUMN [metakey] [nvarchar](1024) NOT NULL DEFAULT '';
ALTER TABLE [#__categories] ALTER COLUMN [metadata] [nvarchar](2048) NOT NULL DEFAULT '';
ALTER TABLE [#__categories] ALTER COLUMN [language] [nvarchar](7) NOT NULL DEFAULT '';

View File

@ -34,7 +34,7 @@ class AdminViewSysinfo extends JViewLegacy
}
header('MIME-Version: 1.0');
header('Content-Disposition: attachment; filename="systeminfo-' . date("c") . '.json"');
header('Content-Disposition: attachment; filename="systeminfo-' . date('c') . '.json"');
header('Content-Transfer-Encoding: binary');
$data = $this->getLayoutData();

View File

@ -35,7 +35,7 @@ class AdminViewSysinfo extends JViewLegacy
header('Content-Type: text/plain; charset=utf-8');
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="systeminfo-' . date("c") . '.txt"');
header('Content-Disposition: attachment; filename="systeminfo-' . date('c') . '.txt"');
header('Cache-Control: must-revalidate');
$data = $this->getLayoutData();
@ -117,9 +117,9 @@ class AdminViewSysinfo extends JViewLegacy
$margin = ($level > 0) ? str_repeat("\t", $level) : null;
$lines[] = $margin . "=============";
$lines[] = $margin . '=============';
$lines[] = $margin . $sectionName;
$lines[] = $margin . "=============";
$lines[] = $margin . '=============';
$level++;
foreach ($sectionData as $name => $value)
@ -131,7 +131,7 @@ class AdminViewSysinfo extends JViewLegacy
continue;
}
$lines[] = "";
$lines[] = '';
$lines[] = $this->renderSection($name, $value, $level);
}
else

View File

@ -11,12 +11,14 @@ defined('JPATH_BASE') or die;
JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php');
JFormHelper::loadFieldClass('list');
/**
* Bannerclient Field class for the Joomla Framework.
*
* @since 1.6
*/
class JFormFieldBannerClient extends JFormAbstractlist
class JFormFieldBannerClient extends JFormFieldList
{
/**
* The form field type.

View File

@ -74,7 +74,7 @@ class BannersTableBanner extends JTable
if (trim(str_replace('-', '', $this->alias)) == '')
{
$this->alias = JFactory::getDate()->format("Y-m-d-H-i-s");
$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
}
// Check the publish down date is not earlier than publish up.

View File

@ -12,24 +12,27 @@ defined('_JEXEC') or die;
$published = $this->state->get('filter.published');
?>
<div class="row">
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('banner.clients'); ?>
</div>
</div>
</div>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="container">
<div class="row">
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.item', 'com_banners'); ?>
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
<?php endif; ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('banner.clients'); ?>
</div>
</div>
</div>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.item', 'com_banners'); ?>
</div>
</div>
<?php endif; ?>
</div>
</div>

View File

@ -114,20 +114,20 @@ $params = (isset($this->state->params)) ? $this->state->params : new JObject
<td class="small hidden-sm-down text-xs-center">
<?php echo $item->contact; ?>
</td>
<td class="text-xs-center btns hidden-sm-down">
<a class="tag <?php if ($item->count_published > 0) echo "tag-success"; ?>" href="<?php echo JRoute::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=1'); ?>">
<td class="center btns hidden-md-down">
<a class="tag <?php if ($item->count_published > 0) echo 'tag-success'; ?>" href="<?php echo JRoute::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=1'); ?>">
<?php echo $item->count_published; ?></a>
</td>
<td class="text-xs-center btns hidden-sm-down">
<a class="tag <?php if ($item->count_unpublished > 0) echo "tag-danger"; ?>" href="<?php echo JRoute::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=0'); ?>">
<td class="center btns hidden-md-down">
<a class="tag <?php if ($item->count_unpublished > 0) echo 'tag-important'; ?>" href="<?php echo JRoute::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=0'); ?>">
<?php echo $item->count_unpublished; ?></a>
</td>
<td class="text-xs-center btns hidden-sm-down">
<a class="tag <?php if ($item->count_archived > 0) echo "tag-info"; ?>" href="<?php echo JRoute::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=2'); ?>">
<td class="center btns hidden-md-down">
<a class="tag <?php if ($item->count_archived > 0) echo 'tag-info'; ?>" href="<?php echo JRoute::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=2'); ?>">
<?php echo $item->count_archived; ?></a>
</td>
<td class="text-xs-center btns hidden-sm-down">
<a class="tag <?php if ($item->count_trashed > 0) echo "tag-inverse"; ?>" href="<?php echo JRoute::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=-2'); ?>">
<td class="center btns hidden-md-down">
<a class="tag <?php if ($item->count_trashed > 0) echo 'tag-inverse'; ?>" href="<?php echo JRoute::_('index.php?option=com_banners&view=banners&filter[client_id]=' . (int) $item->id . '&filter[published]=-2'); ?>">
<?php echo $item->count_trashed; ?></a>
</td>
<td class="small hidden-sm-down text-xs-center">

View File

@ -76,7 +76,24 @@ $listDirn = $this->escape($this->state->get('list.direction'));
</tbody>
</table>
<?php endif; ?>
<?php // Load the export form ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'downloadModal',
array(
'title' => JText::_('COM_BANNERS_TRACKS_DOWNLOAD'),
'url' => JRoute::_('index.php?option=com_banners&amp;view=download&amp;tmpl=component'),
'height' => '370px',
'width' => '300px',
'modalWidth' => '40',
'footer' => '<a class="btn" data-dismiss="modal" type="button"'
. ' onclick="jQuery(\'#downloadModal iframe\').contents().find(\'#closeBtn\').click();">'
. JText::_('COM_BANNERS_CANCEL') . '</a>'
. '<button class="btn btn-success" type="button"'
. ' onclick="jQuery(\'#downloadModal iframe\').contents().find(\'#exportBtn\').click();">'
. JText::_('COM_BANNERS_TRACKS_EXPORT') . '</button>',
)
); ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHtml::_('form.token'); ?>

View File

@ -1,41 +0,0 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
$data = $displayData;
// Receive overridable options
$data['options'] = !empty($data['options']) ? $data['options'] : array();
if ($data['view'] instanceof CacheViewCache)
{
JFactory::getDocument()->addStyleDeclaration("
/* Fixed filter field in search bar */
.js-stools .js-stools-client_id {
float: left;
margin-right: 10px;
min-width: 220px;
}
html[dir=rtl] .js-stools .js-stools-client_id {
float: right;
margin-left: 10px
margin-right: 0;
}
.js-stools .js-stools-container-bar .js-stools-field-filter .chzn-container {
padding: 3px 0;
}
");
// Client id filter doesn't have to activate the filter bar
unset($data['view']->activeFilters['client_id']);
}
// Display the main joomla layout
echo JLayoutHelper::render('joomla.searchtools.default', $data, null, array('component' => 'none'));

View File

@ -1,25 +0,0 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
$data = $displayData;
if ($data['view'] instanceof CacheViewCache)
{
$clientIdField = $data['view']->filterForm->getField('client_id');
?>
<div class="js-stools-field-filter js-stools-client_id">
<?php echo $clientIdField->input; ?>
</div>
<?php
}
// Display the main joomla layout
echo JLayoutHelper::render('joomla.searchtools.default.bar', $data, null, array('component' => 'none'));

View File

@ -3,8 +3,8 @@
<field
name="client_id"
type="list"
label=""
onchange="jQuery('#filter_search, select[id^=filter_], #list_fullordering').val('');this.form.submit();"
filtermode="selector"
>
<option value="0">JSITE</option>
<option value="1">JADMINISTRATOR</option>
@ -16,6 +16,7 @@
label="COM_CACHE_FILTER_SEARCH_LABEL"
description="COM_CACHE_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
noresults="JGLOBAL_NO_MATCHING_RESULTS"
/>
</fields>
<fields name="list">

View File

@ -17,7 +17,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo JRoute::_('index.php?option=com_cache'); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-main-container" class="j-main-container">
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('filterButton' => false, 'totalResults' => count($this->data)))); ?>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (count($this->data) > 0) : ?>
<table class="table table-striped">
<thead>

View File

@ -39,6 +39,7 @@ class CacheViewCache extends JViewLegacy
{
$this->data = $this->get('Data');
$this->pagination = $this->get('Pagination');
$this->total = $this->get('Total');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

View File

@ -11,12 +11,14 @@ defined('JPATH_BASE') or die;
use Joomla\Utilities\ArrayHelper;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for the Joomla Framework.
*
* @since 1.6
*/
class JFormFieldCategoryEdit extends JFormAbstractlist
class JFormFieldCategoryEdit extends JFormFieldList
{
/**
* To allow creation of new categories.

View File

@ -9,12 +9,14 @@
defined('JPATH_BASE') or die;
JFormHelper::loadFieldClass('list');
/**
* Form Field class for the Joomla Framework.
*
* @since 1.6
*/
class JFormFieldCategoryParent extends JFormAbstractlist
class JFormFieldCategoryParent extends JFormFieldList
{
/**
* The form field type.

View File

@ -207,7 +207,7 @@ class JFormFieldModal_Category extends JFormField
'width' => '800px',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<a role="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">' . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>',
'footer' => '<a role="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">' . JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>',
)
);
}
@ -230,13 +230,13 @@ class JFormFieldModal_Category extends JFormField
'modalWidth' => 80,
'footer' => '<a role="button" class="btn btn-secondary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'category\', \'cancel\', \'item-form\'); return false;">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<a role="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'category\', \'save\', \'item-form\'); return false;">'
. JText::_("JSAVE") . '</a>'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'category\', \'apply\', \'item-form\'); return false;">'
. JText::_("JAPPLY") . '</a>',
. JText::_('JAPPLY') . '</a>',
)
);
}
@ -259,13 +259,13 @@ class JFormFieldModal_Category extends JFormField
'modalWidth' => 80,
'footer' => '<a role="button" class="btn btn-secondary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'category\', \'cancel\', \'item-form\'); return false;">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<a role="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'category\', \'save\', \'item-form\'); return false;">'
. JText::_("JSAVE") . '</a>'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'category\', \'apply\', \'item-form\'); return false;">'
. JText::_("JAPPLY") . '</a>',
. JText::_('JAPPLY') . '</a>',
)
);
}
@ -284,7 +284,7 @@ class JFormFieldModal_Category extends JFormField
*
* @return string The field label markup.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getLabel()
{

View File

@ -134,18 +134,18 @@ if ($saveOrder)
// Get the parents of item for sorting
if ($item->level > 1)
{
$parentsStr = "";
$parentsStr = '';
$_currentParentId = $item->parent_id;
$parentsStr = " " . $_currentParentId;
$parentsStr = ' ' . $_currentParentId;
for ($i2 = 0; $i2 < $item->level; $i2++)
{
foreach ($this->ordering as $k => $v)
{
$v = implode("-", $v);
$v = "-" . $v . "-";
if (strpos($v, "-" . $_currentParentId . "-") !== false)
$v = implode('-', $v);
$v = '-' . $v . '-';
if (strpos($v, '-' . $_currentParentId . '-') !== false)
{
$parentsStr .= " " . $k;
$parentsStr .= ' ' . $k;
$_currentParentId = $k;
break;
}
@ -154,7 +154,7 @@ if ($saveOrder)
}
else
{
$parentsStr = "";
$parentsStr = '';
}
?>
<tr class="row<?php echo $i % 2; ?>" data-dragable-group="<?php echo $item->parent_id; ?>" item-id="<?php echo $item->id ?>" parents="<?php echo $parentsStr ?>" level="<?php echo $item->level ?>">

View File

@ -18,41 +18,39 @@ $extension = $this->escape($this->state->get('filter.extension'));
JHtml::_('formbehavior.chosen', '.chzn-custom-value');
?>
<div class="row">
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.language'); ?>
<div class="container-fluid">
<div class="row">
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.access'); ?>
</div>
</div>
</div>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.access'); ?>
</div>
</div>
</div>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="col-md-6">
<div class="control-group">
<label id="batch-choose-action-lbl" for="batch-category-id" class="control-label">
<?php echo JText::_('JLIB_HTML_BATCH_MENU_LABEL'); ?>
</label>
<div id="batch-choose-action" class="combo controls">
<select class="chzn-custom-value" name="batch[category_id]" id="batch-category-id">
<option value=""><?php echo JText::_('JLIB_HTML_BATCH_NO_CATEGORY'); ?></option>
<?php echo JHtml::_('select.options', JHtml::_('category.categories', $extension, array('filter.published' => $published))); ?>
</select>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="col-md-6">
<div class="control-group">
<label id="batch-choose-action-lbl" for="batch-category-id" class="control-label">
<?php echo JText::_('JLIB_HTML_BATCH_MENU_LABEL'); ?>
</label>
<div id="batch-choose-action" class="combo controls">
<select class="chzn-custom-value" name="batch[category_id]" id="batch-category-id">
<option value=""><?php echo JText::_('JLIB_HTML_BATCH_NO_CATEGORY'); ?></option>
<?php echo JHtml::_('select.options', JHtml::_('category.categories', $extension, array('filter.published' => $published))); ?>
</select>
</div>
</div>
<?php endif; ?>
<div class="control-group span6">
<div class="controls">
<?php echo JHtml::_('batch.tag'); ?>
</div>
</div>
<div id="batch-copy-move" class="control-group radio">
<?php echo JText::_('JLIB_HTML_BATCH_MOVE_QUESTION'); ?>
<?php echo JHtml::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'); ?>
</div>
</div>
<?php endif; ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.tag'); ?>
</div>
</div>
</div>

View File

@ -97,12 +97,12 @@ $listDirn = $this->escape($this->state->get('list.direction'));
}
else
{
$lang = "";
$lang = '';
}
}
elseif (!JLanguageMultilang::isEnabled())
{
$lang = "";
$lang = '';
}
?>
<tr class="row<?php echo $i % 2; ?>">

View File

@ -29,10 +29,10 @@ JFactory::getDocument()->addScriptDeclaration('
if (task == "category.cancel" || document.formvalidator.isValid(document.getElementById("item-form")))
{
jQuery("#permissions-sliders select").attr("disabled", "disabled");
' . $this->form->getField("description")->save() . '
' . $this->form->getField('description')->save() . '
Joomla.submitform(task, document.getElementById("item-form"));
// @deprecated 4.0 The following js is not needed since __DEPLOY_VERSION__.
// @deprecated 4.0 The following js is not needed since 3.7.0.
if (task !== "category.apply")
{
window.parent.jQuery("#categoryEdit' . $this->item->id . 'Modal").modal("hide");

View File

@ -11,7 +11,7 @@ defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since __DEPLOY_VERSION__.
// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since 3.7.0.
$function = JFactory::getApplication()->input->getCmd('function', 'jEditCategory_' . (int) $this->item->id);
// Function to update input title when changed

View File

@ -7,6 +7,7 @@
label="COM_CHECKIN_FILTER_SEARCH_LABEL"
description="COM_CHECKIN_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
noresults="COM_CHECKIN_NO_ITEMS"
/>
</fields>
<fields name="list">

View File

@ -18,7 +18,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo JRoute::_('index.php?option=com_checkin'); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-main-container" class="j-main-container">
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('filterButton' => false))); ?>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<div class="clearfix"></div>
<?php if (empty($this->items)) : ?>
<div class="alert alert-warning alert-no-items">

View File

@ -61,15 +61,12 @@ class CheckinViewCheckin extends JViewLegacy
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
if ($this->getLayout() == 'default')
{
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
}
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->total = $this->get('Total');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
// Check for errors.
if (count($errors = $this->get('Errors')))

View File

@ -110,7 +110,7 @@ class ConfigModelApplication extends ConfigModelForm
try
{
$dbc = JDatabaseDriver::getInstance($options)->getVersion();
JDatabaseDriver::getInstance($options)->getVersion();
}
catch (Exception $e)
{
@ -279,20 +279,95 @@ class ConfigModelApplication extends ConfigModelForm
$data['caching'] = 0;
}
$path = JPATH_SITE . '/cache';
/*
* Look for a custom cache_path
* First check if a path is given in the submitted data, then check if a path exists in the previous data, otherwise use the default
*/
if ($data['cache_path'])
{
$path = $data['cache_path'];
}
elseif (!$data['cache_path'] && $prev['cache_path'])
{
$path = $prev['cache_path'];
}
else
{
$path = JPATH_SITE . '/cache';
}
// Give a warning if the cache-folder can not be opened
if ($data['caching'] > 0 && $data['cache_handler'] == 'file' && @opendir($path) == false)
{
JLog::add(JText::sprintf('COM_CONFIG_ERROR_CACHE_PATH_NOTWRITABLE', $path), JLog::WARNING, 'jerror');
$data['caching'] = 0;
$error = true;
// If a custom path is in use, try using the system default instead of disabling cache
if ($path !== JPATH_SITE . '/cache' && @opendir(JPATH_SITE . '/cache') != false)
{
try
{
JLog::add(
JText::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_SITE . '/cache'),
JLog::WARNING,
'jerror'
);
}
catch (RuntimeException $logException)
{
$app->enqueueMessage(
JText::sprintf('COM_CONFIG_ERROR_CUSTOM_CACHE_PATH_NOTWRITABLE_USING_DEFAULT', $path, JPATH_SITE . '/cache'),
'warning'
);
}
$path = JPATH_SITE . '/cache';
$error = false;
$data['cache_path'] = '';
}
if ($error)
{
JLog::add(JText::sprintf('COM_CONFIG_ERROR_CACHE_PATH_NOTWRITABLE', $path), JLog::WARNING, 'jerror');
$data['caching'] = 0;
}
}
// Clean the cache if disabled but previously enabled.
if (!$data['caching'] && $prev['caching'])
// Did the user remove their custom cache path? Don't save the variable to the config
if (empty($data['cache_path']))
{
$cache = JFactory::getCache();
$cache->clean();
unset($data['cache_path']);
}
// Clean the cache if disabled but previously enabled or changing cache handlers; these operations use the `$prev` data already in memory
if ((!$data['caching'] && $prev['caching']) || $data['cache_handler'] !== $prev['cache_handler'])
{
try
{
JFactory::getCache()->clean();
}
catch (JCacheExceptionConnecting $exception)
{
try
{
JLog::add(JText::_('COM_CONFIG_ERROR_CACHE_CONNECTION_FAILED'), JLog::WARNING, 'jerror');
}
catch (RuntimeException $logException)
{
$app->enqueueMessage(JText::_('COM_CONFIG_ERROR_CACHE_CONNECTION_FAILED'), 'warning');
}
}
catch (JCacheExceptionUnsupported $exception)
{
try
{
JLog::add(JText::_('COM_CONFIG_ERROR_CACHE_DRIVER_UNSUPPORTED'), JLog::WARNING, 'jerror');
}
catch (RuntimeException $logException)
{
$app->enqueueMessage(JText::_('COM_CONFIG_ERROR_CACHE_DRIVER_UNSUPPORTED'), 'warning');
}
}
}
// Create the new configuration object.

View File

@ -40,6 +40,15 @@
showon="caching:1,2"
size="6" />
<field
name="cache_path"
type="text"
label="COM_CONFIG_FIELD_CACHE_PATH_LABEL"
description="COM_CONFIG_FIELD_CACHE_PATH_DESC"
showon="cache_handler:file"
filter="string"
size="50" />
<field
name="memcache_persist"
type="radio"

View File

@ -45,20 +45,20 @@ class ConfigViewApplicationJson extends ConfigViewCmsJson
// Required data
$requiredData = array(
"sitename" => null,
"offline" => null,
"access" => null,
"list_limit" => null,
"MetaDesc" => null,
"MetaKeys" => null,
"MetaRights" => null,
"sef" => null,
"sitename_pagetitles" => null,
"debug" => null,
"debug_lang" => null,
"error_reporting" => null,
"mailfrom" => null,
"fromname" => null
'sitename' => null,
'offline' => null,
'access' => null,
'list_limit' => null,
'MetaDesc' => null,
'MetaKeys' => null,
'MetaRights' => null,
'sef' => null,
'sitename_pagetitles' => null,
'debug' => null,
'debug_lang' => null,
'error_reporting' => null,
'mailfrom' => null,
'fromname' => null
);
$this->data = array_intersect_key($this->data, $requiredData);

View File

@ -54,7 +54,8 @@ class ConfigViewComponentHtml extends ConfigViewCmsHtml
$form->bind($component->params);
}
$this->fieldsets = $form->getFieldsets();
$this->fieldsets = $form->getFieldsets();
$this->formControl = $form->getFormControl();
// Don't show permissions fieldset if not authorised.
if (!$user->authorise('core.admin', $component->option) && isset($this->fieldsets['permissions']))

View File

@ -56,23 +56,14 @@ JFactory::getDocument()->addScriptDeclaration(
<ul class="nav nav-tabs" id="configTabs">
<?php foreach ($this->fieldsets as $name => $fieldSet) : ?>
<?php $rel = ''; ?>
<?php $dataShowOn = ''; ?>
<?php if (!empty($fieldSet->showon)) : ?>
<?php JHtml::_('jquery.framework'); ?>
<?php JHtml::_('script', 'jui/cms.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $showonarr = array(); ?>
<?php foreach (preg_split('%\[AND\]|\[OR\]%', $fieldSet->showon) as $showonfield) : ?>
<?php $showon = explode(':', $showonfield, 2); ?>
<?php $showonarr[] = array(
'field' => $this->form->getFormControl() . '[' . $showon[0] . ']',
'values' => explode(',', $showon[1]),
'op' => (preg_match('%\[(AND|OR)\]' . $showonfield . '%', $fieldSet->showon, $matches)) ? $matches[1] : ''
); ?>
<?php endforeach; ?>
<?php $rel = ' data-showon=\'' . json_encode($showonarr) . '\''; ?>
<?php $dataShowOn = ' data-showon=\'' . json_encode(JFormHelper::parseShowOnConditions($this->formControl, $fieldSet->showon)) . '\''; ?>
<?php endif; ?>
<?php $label = empty($fieldSet->label) ? 'COM_CONFIG_' . $name . '_FIELDSET_LABEL' : $fieldSet->label; ?>
<li class="nav-item"<?php echo $rel; ?>><a class="nav-link" data-toggle="tab" href="#<?php echo $name; ?>"><?php echo JText::_($label); ?></a></li>
<li class="nav-item"<?php echo $dataShowOn; ?>><a class="nav-link" data-toggle="tab" href="#<?php echo $name; ?>"><?php echo JText::_($label); ?></a></li>
<?php endforeach; ?>
</ul>
@ -85,31 +76,22 @@ JFactory::getDocument()->addScriptDeclaration(
</div>
<?php endif; ?>
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<?php $datashowon = ''; ?>
<?php if ($showonstring = $field->getAttribute('showon')) : ?>
<?php $dataShowOn = ''; ?>
<?php if ($field->showon) : ?>
<?php JHtml::_('jquery.framework'); ?>
<?php JHtml::_('script', 'jui/cms.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $showonarr = array(); ?>
<?php foreach (preg_split('%\[AND\]|\[OR\]%', $showonstring) as $showonfield) : ?>
<?php $showon = explode(':', $showonfield, 2); ?>
<?php $showonarr[] = array(
'field' => $this->form->getFormControl() . '[' . $this->form->getFieldAttribute($showon[0], 'name') . ']',
'values' => explode(',', $showon[1]),
'op' => (preg_match('%\[(AND|OR)\]' . $showonfield . '%', $showonstring, $matches)) ? $matches[1] : ''
); ?>
<?php endforeach; ?>
<?php $datashowon = ' data-showon=\'' . json_encode($showonarr) . '\''; ?>
<?php $dataShowOn = ' data-showon=\'' . json_encode(JFormHelper::parseShowOnConditions($field->formControl, $field->showon)) . '\''; ?>
<?php endif; ?>
<?php if ($field->hidden) : ?>
<?php echo $field->input; ?>
<?php else : ?>
<div class="control-group"<?php echo $datashowon; ?>>
<?php if ($name != "permissions") : ?>
<div class="control-group"<?php echo $dataShowOn; ?>>
<?php if ($name != 'permissions') : ?>
<div class="control-label">
<?php echo $field->label; ?>
</div>
<?php endif; ?>
<div class="<?php if ($name != "permissions") : ?>controls<?php endif; ?>">
<div class="<?php if ($name != 'permissions') : ?>controls<?php endif; ?>">
<?php echo $field->input; ?>
</div>
</div>

View File

@ -5,6 +5,7 @@
name="contact"
label="COM_CONTACT_FIELD_CONFIG_INDIVIDUAL_CONTACT_DISPLAY"
description="COM_CONTACT_FIELD_CONFIG_INDIVIDUAL_CONTACT_DESC"
addfieldpath="/administrator/components/com_fields/models/fields"
>
<field
@ -338,9 +339,9 @@
<field
name="show_user_custom_fields"
type="category"
type="fieldgroups"
multiple="true"
extension="com_users.user.fields"
context="com_users.user"
label="COM_CONTACT_FIELD_USER_CUSTOM_FIELDS_SHOW_LABEL"
description="COM_CONTACT_FIELD_USER_CUSTOM_FIELDS_SHOW_DESC"
>

View File

@ -122,7 +122,6 @@ class ContactHelper extends JHelperContent
{
$db = JFactory::getDbo();
$parts = explode('.', $extension);
$component = $parts[0];
$section = null;
if (count($parts) > 1)
{
@ -177,12 +176,39 @@ class ContactHelper extends JHelperContent
return $items;
}
/**
* Returns a valid section for contacts. If it is not valid then null
* is returned.
*
* @param string $section The section to get the mapping for
*
* @return string|null The new section
*
* @since __DEPLOY_VERSION__
*/
public static function validateSection($section)
{
if (JFactory::getApplication()->isClient('site') && $section == 'contact')
{
// The contact form needs to be the mail section
$section = 'mail';
}
if ($section != 'mail' && $section != 'contact')
{
// We don't know other sections
return null;
}
return $section;
}
/**
* Returns valid contexts
*
* @return array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function getContexts()
{

View File

@ -196,7 +196,7 @@ class JFormFieldModal_Contact extends JFormField
'width' => '800px',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<a role="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">' . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>',
'footer' => '<a role="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">' . JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>',
)
);
}
@ -220,15 +220,15 @@ class JFormFieldModal_Contact extends JFormField
'footer' => '<a role="button" class="btn btn-secondary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\', \'contact\', \'cancel\', \'contact-form\', \'jform_id\', \'jform_name\'); return false;">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<a role="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\', \'contact\', \'save\', \'contact-form\', \'jform_id\', \'jform_name\'); return false;">'
. JText::_("JSAVE") . '</a>'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'add\', \'contact\', \'apply\', \'contact-form\', \'jform_id\', \'jform_name\'); return false;">'
. JText::_("JAPPLY") . '</a>',
. JText::_('JAPPLY') . '</a>',
)
);
}
@ -252,15 +252,15 @@ class JFormFieldModal_Contact extends JFormField
'footer' => '<a role="button" class="btn btn-secondary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id
. '\', \'edit\', \'contact\', \'cancel\', \'contact-form\', \'jform_id\', \'jform_name\'); return false;">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<a role="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'edit\', \'contact\', \'save\', \'contact-form\', \'jform_id\', \'jform_name\'); return false;">'
. JText::_("JSAVE") . '</a>'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \''
. $this->id . '\', \'edit\', \'contact\', \'apply\', \'contact-form\', \'jform_id\', \'jform_name\'); return false;">'
. JText::_("JAPPLY") . '</a>',
. JText::_('JAPPLY') . '</a>',
)
);
}

View File

@ -182,10 +182,10 @@ class ContactTableContact extends JTable
if (!empty($this->metakey))
{
// Array of characters to remove.
$badCharacters = array("\n", "\r", "\"", "<", ">");
$badCharacters = array("\n", "\r", "\"", '<', '>');
// Remove bad characters.
$afterClean = StringHelper::str_ireplace($badCharacters, "", $this->metakey);
$afterClean = StringHelper::str_ireplace($badCharacters, '', $this->metakey);
// Create array using commas as delimiter.
$keys = explode(',', $afterClean);
@ -201,15 +201,15 @@ class ContactTableContact extends JTable
}
// Put array back together delimited by ", "
$this->metakey = implode(", ", $cleanKeys);
$this->metakey = implode(', ', $cleanKeys);
}
// Clean up description -- eliminate quotes and <> brackets
if (!empty($this->metadesc))
{
// Only process if not empty
$badCharacters = array("\"", "<", ">");
$this->metadesc = StringHelper::str_ireplace($badCharacters, "", $this->metadesc);
$badCharacters = array("\"", '<', '>');
$this->metadesc = StringHelper::str_ireplace($badCharacters, '', $this->metadesc);
}
return true;
@ -232,7 +232,7 @@ class ContactTableContact extends JTable
if (trim(str_replace('-', '', $this->alias)) == '')
{
$this->alias = JFactory::getDate()->format("Y-m-d-H-i-s");
$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
}
return $this->alias;

View File

@ -26,10 +26,10 @@ JFactory::getDocument()->addScriptDeclaration('
{
if (task == "contact.cancel" || document.formvalidator.isValid(document.getElementById("contact-form")))
{
' . $this->form->getField("misc")->save() . '
' . $this->form->getField('misc')->save() . '
Joomla.submitform(task, document.getElementById("contact-form"));
// @deprecated 4.0 The following js is not needed since __DEPLOY_VERSION__.
// @deprecated 4.0 The following js is not needed since 3.7.0.
if (task !== "contact.apply")
{
window.parent.jQuery("#contactEdit' . $this->item->id . 'Modal").modal("hide");

View File

@ -11,7 +11,7 @@ defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since __DEPLOY_VERSION__.
// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since 3.7.0.
$function = JFactory::getApplication()->input->getCmd('function', 'jEditContact_' . (int) $this->item->id);
// Function to update input title when changed

View File

@ -10,34 +10,36 @@ defined('_JEXEC') or die;
$published = $this->state->get('filter.published');
?>
<div class="row">
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.access'); ?>
</div>
</div>
</div>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="container">
<div class="row">
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.item', 'com_contact'); ?>
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
<?php endif; ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.tag'); ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.access'); ?>
</div>
</div>
</div>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.user'); ?>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.item', 'com_contact'); ?>
</div>
</div>
<?php endif; ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.tag'); ?>
</div>
</div>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.user'); ?>
</div>
</div>
</div>
</div>

View File

@ -95,12 +95,12 @@ $listDirn = $this->escape($this->state->get('list.direction'));
$lang = substr($item->language, 0, 3);
}
else {
$lang = "";
$lang = '';
}
}
elseif (!JLanguageMultilang::isEnabled())
{
$lang = "";
$lang = '';
}
?>
<tr class="row<?php echo $i % 2; ?>">
@ -111,7 +111,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<a href="javascript:void(0);" onclick="if (window.parent) window.parent.<?php echo $this->escape($function); ?>('<?php echo $item->id; ?>', '<?php echo $this->escape(addslashes($item->name)); ?>', '<?php echo $this->escape($item->catid); ?>', null, '<?php echo $this->escape(ContactHelperRoute::getContactRoute($item->id, $item->catid, $item->language)); ?>', '<?php echo $this->escape($lang); ?>', null);">
<?php echo $this->escape($item->name); ?></a>
<div class="small">
<?php echo JText::_('JCATEGORY') . ": " . $this->escape($item->category_title); ?>
<?php echo JText::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
</div>
</td>
<td>

View File

@ -726,7 +726,9 @@
type="list"
default="0"
label="JGLOBAL_MULTI_COLUMN_ORDER_LABEL"
description="JGLOBAL_MULTI_COLUMN_ORDER_DESC">
description="JGLOBAL_MULTI_COLUMN_ORDER_DESC"
showon="num_columns!:,0,1"
>
<option
value="0">JGLOBAL_DOWN</option>
<option

View File

@ -145,7 +145,6 @@ class ContentHelper extends JHelperContent
{
$db = JFactory::getDbo();
$parts = explode('.', $extension);
$component = $parts[0];
$section = null;
if (count($parts) > 1)
@ -205,12 +204,47 @@ class ContentHelper extends JHelperContent
return $items;
}
/**
* Returns a valid section for articles. If it is not valid then null
* is returned.
*
* @param string $section The section to get the mapping for
*
* @return string|null The new section
*
* @since __DEPLOY_VERSION__
*/
public static function validateSection($section)
{
if (JFactory::getApplication()->isClient('site'))
{
// On the front end we need to map some sections
switch ($section)
{
// Editing an article
case 'form':
// Category list view
case 'category':
$section = 'article';
}
}
if ($section != 'article')
{
// We don't know other sections
return null;
}
return $section;
}
/**
* Returns valid contexts
*
* @return array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function getContexts()
{

View File

@ -810,7 +810,7 @@ class ContentModelArticle extends JModelAdmin
*
* @return boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function delete(&$pks)
{

View File

@ -14,7 +14,7 @@ defined('JPATH_BASE') or die;
*
* @since 1.6
*/
class JFormFieldModal_Article extends JFormField implements JFormDomfieldinterface
class JFormFieldModal_Article extends JFormField
{
/**
* The form field type.
@ -197,9 +197,9 @@ class JFormFieldModal_Article extends JFormField implements JFormDomfieldinterfa
'url' => $urlSelect,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'footer' => '<a role="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">' . JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<a role="button" class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">' . JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>',
)
);
}
@ -218,17 +218,17 @@ class JFormFieldModal_Article extends JFormField implements JFormDomfieldinterfa
'url' => $urlNew,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<a role="button" class="btn btn-secondary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'article\', \'cancel\', \'item-form\'); return false;">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<a role="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'article\', \'save\', \'item-form\'); return false;">'
. JText::_("JSAVE") . '</a>'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'add\', \'article\', \'apply\', \'item-form\'); return false;">'
. JText::_("JAPPLY") . '</a>',
. JText::_('JAPPLY') . '</a>',
)
);
}
@ -247,17 +247,17 @@ class JFormFieldModal_Article extends JFormField implements JFormDomfieldinterfa
'url' => $urlEdit,
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<a role="button" class="btn btn-secondary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'article\', \'cancel\', \'item-form\'); return false;">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</a>'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</a>'
. '<a role="button" class="btn btn-primary" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'article\', \'save\', \'item-form\'); return false;">'
. JText::_("JSAVE") . '</a>'
. JText::_('JSAVE') . '</a>'
. '<a role="button" class="btn btn-success" aria-hidden="true"'
. ' onclick="window.processModalEdit(this, \'' . $this->id . '\', \'edit\', \'article\', \'apply\', \'item-form\'); return false;">'
. JText::_("JAPPLY") . '</a>',
. JText::_('JAPPLY') . '</a>',
)
);
}

View File

@ -70,7 +70,7 @@ JFactory::getDocument()->addScriptDeclaration('
' . $this->form->getField('articletext')->save() . '
Joomla.submitform(task, document.getElementById("item-form"));
// @deprecated 4.0 The following js is not needed since __DEPLOY_VERSION__.
// @deprecated 4.0 The following js is not needed since 3.7.0.
if (task !== "article.apply")
{
window.parent.jQuery("#articleEdit' . (int) $this->item->id . 'Modal").modal("hide");

View File

@ -11,7 +11,7 @@ defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since __DEPLOY_VERSION__.
// @deprecated 4.0 the function parameter, the inline js and the buttons are not needed since 3.7.0.
$function = JFactory::getApplication()->input->getCmd('function', 'jEditArticle_' . (int) $this->item->id);
// Function to update input title when changed

View File

@ -171,7 +171,7 @@ $assoc = JLanguageAssociations::isEnabled();
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
</span>
<div class="small">
<?php echo JText::_('JCATEGORY') . ": " . $this->escape($item->category_title); ?>
<?php echo JText::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
</div>
</div>
</td>

View File

@ -10,29 +10,26 @@ defined('_JEXEC') or die;
$published = $this->state->get('filter.published');
?>
<div class="row">
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.access'); ?>
</div>
</div>
</div>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="container">
<div class="row">
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.item', 'com_content'); ?>
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
<?php endif; ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.tag'); ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.access'); ?>
</div>
</div>
</div>
<div class="row">
<?php if ($published >= 0) : ?>
<div class="form-group col-md-6">
<div class="controls">
<?php echo JHtml::_('batch.tag'); ?>
</div>
</div>
<?php endif; ?>
</div>
</div>

View File

@ -97,12 +97,12 @@ $listDirn = $this->escape($this->state->get('list.direction'));
$lang = substr($item->language, 0, 3);
}
else {
$lang = "";
$lang = '';
}
}
elseif (!JLanguageMultilang::isEnabled())
{
$lang = "";
$lang = '';
}
?>
<tr class="row<?php echo $i % 2; ?>">
@ -113,7 +113,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<a href="javascript:void(0);" onclick="if (window.parent) window.parent.<?php echo $this->escape($function); ?>('<?php echo $item->id; ?>', '<?php echo $this->escape(addslashes($item->title)); ?>', '<?php echo $this->escape($item->catid); ?>', null, '<?php echo $this->escape(ContentHelperRoute::getArticleRoute($item->id, $item->catid, $item->language)); ?>', '<?php echo $this->escape($lang); ?>', null);">
<?php echo $this->escape($item->title); ?></a>
<div class="small">
<?php echo JText::_('JCATEGORY') . ": " . $this->escape($item->category_title); ?>
<?php echo JText::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
</div>
</td>
<td class="small hidden-sm-down">

View File

@ -120,11 +120,11 @@ class ContenthistoryHelper
if (isset($expandedObjectArray[$name]))
{
$optionFieldArray = $field->xpath('option[@value="' . $expandedObjectArray[$name] . '"]');
$valueText = null;
if (is_array($optionFieldArray) && count($optionFieldArray))
{
{
$valueText = trim((string) $optionFieldArray[0]);
}

View File

@ -29,10 +29,14 @@ class ContenthistoryModelHistory extends JModelList
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'version_id', 'h.version_id',
'version_note', 'h.version_note',
'save_date', 'h.save_date',
'editor_user_id', 'h.editor_user_id',
'version_id',
'h.version_id',
'version_note',
'h.version_note',
'save_date',
'h.save_date',
'editor_user_id',
'h.editor_user_id',
);
}
@ -339,13 +343,13 @@ class ContenthistoryModelHistory extends JModelList
'h.character_count, h.sha1_hash, h.version_data, h.keep_forever'
)
)
->from($db->quoteName('#__ucm_history') . ' AS h')
->where($db->quoteName('h.ucm_item_id') . ' = ' . (int) $this->getState('item_id'))
->where($db->quoteName('h.ucm_type_id') . ' = ' . (int) $this->getState('type_id'))
->from($db->quoteName('#__ucm_history') . ' AS h')
->where($db->quoteName('h.ucm_item_id') . ' = ' . (int) $this->getState('item_id'))
->where($db->quoteName('h.ucm_type_id') . ' = ' . (int) $this->getState('type_id'))
// Join over the users for the editor
->select('uc.name AS editor')
->join('LEFT', '#__users AS uc ON uc.id = h.editor_user_id');
->select('uc.name AS editor')
->join('LEFT', '#__users AS uc ON uc.id = h.editor_user_id');
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering');
@ -369,7 +373,7 @@ class ContenthistoryModelHistory extends JModelList
$typeId = JFactory::getApplication()->input->getInteger('type_id', 0);
$typeTable->load($typeId);
$typeAliasArray = explode('.', $typeTable->type_alias);
JTable::addIncludePath(JPATH_ROOT . '/administrator/components/' . $typeAliasArray[0] . '/tables');
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/' . $typeAliasArray[0] . '/tables');
$contentTable = $typeTable->getContentTable();
$keyValue = JFactory::getApplication()->input->getInteger('item_id', 0);

View File

@ -20,9 +20,10 @@ $field = $input->getCmd('field');
$function = 'jSelectContenthistory_' . $field;
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$message = addslashes(JText::_('COM_CONTENTHISTORY_BUTTON_SELECT_ONE'));
$compareMessage = addslashes(JText::_('COM_CONTENTHISTORY_BUTTON_SELECT_TWO'));
$deleteMessage = addslashes(JText::_('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'));
$message = JText::_('COM_CONTENTHISTORY_BUTTON_SELECT_ONE', true);
$compareMessage = JText::_('COM_CONTENTHISTORY_BUTTON_SELECT_TWO', true);
JText::script('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST');
$deleteMessage = "alert(Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'));";
$aliasArray = explode('.', $this->state->type_alias);
$option = (end($aliasArray) == 'category') ? 'com_categories&amp;extension=' . implode('.', array_slice($aliasArray, 0, count($aliasArray) - 1)) : $aliasArray[0];
$filter = JFilterInput::getInstance();
@ -91,20 +92,15 @@ JFactory::getDocument()->addScriptDeclaration("
<div class="btn-group float-xs-right">
<button id="toolbar-load" type="submit" class="btn btn-secondary hasTooltip" title="<?php echo JText::_('COM_CONTENTHISTORY_BUTTON_LOAD_DESC'); ?>" data-url="<?php echo JRoute::_($loadUrl); ?>">
<span class="icon-upload"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_LOAD'); ?></span>
</button>
<span class="icon-upload"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_LOAD'); ?></span></button>
<button id="toolbar-preview" type="button" class="btn btn-secondary hasTooltip" title="<?php echo JText::_('COM_CONTENTHISTORY_BUTTON_PREVIEW_DESC'); ?>" data-url="<?php echo JRoute::_('index.php?option=com_contenthistory&view=preview&layout=preview&tmpl=component&' . JSession::getFormToken() . '=1'); ?>">
<span class="icon-search"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_PREVIEW'); ?></span>
</button>
<span class="icon-search"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_PREVIEW'); ?></span></button>
<button id="toolbar-compare" type="button" class="btn btn-secondary hasTooltip" title="<?php echo JText::_('COM_CONTENTHISTORY_BUTTON_COMPARE_DESC'); ?>" data-url="<?php echo JRoute::_('index.php?option=com_contenthistory&view=compare&layout=compare&tmpl=component&' . JSession::getFormToken() . '=1'); ?>">
<span class="icon-zoom-in"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_COMPARE'); ?></span>
</button>
<button onclick="if (document.adminForm.boxchecked.value==0){alert('<?php echo $deleteMessage; ?>');}else{ Joomla.submitbutton('history.keep')}" class="btn btn-secondary hasTooltip" title="<?php echo JText::_('COM_CONTENTHISTORY_BUTTON_KEEP_DESC'); ?>">
<span class="icon-lock"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_KEEP'); ?></span>
</button>
<button onclick="if (document.adminForm.boxchecked.value==0){alert('<?php echo $deleteMessage; ?>');}else{ Joomla.submitbutton('history.delete')}" class="btn btn-secondary hasTooltip" title="<?php echo JText::_('COM_CONTENTHISTORY_BUTTON_DELETE_DESC'); ?>">
<span class="icon-delete"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_DELETE'); ?></span>
</button>
<span class="icon-zoom-in"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_COMPARE'); ?></span></button>
<button onclick="if (document.adminForm.boxchecked.value==0){<?php echo $deleteMessage; ?>}else{ Joomla.submitbutton('history.keep')}" class="btn btn-secondary pointer hasTooltip" title="<?php echo JText::_('COM_CONTENTHISTORY_BUTTON_KEEP_DESC'); ?>">
<span class="icon-lock"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_KEEP'); ?></span></button>
<button onclick="if (document.adminForm.boxchecked.value==0){<?php echo $deleteMessage; ?>}else{ Joomla.submitbutton('history.delete')}" class="btn btn-secondary pointer hasTooltip" title="<?php echo JText::_('COM_CONTENTHISTORY_BUTTON_DELETE_DESC'); ?>">
<span class="icon-delete"></span><span class="hidden-sm-down"><?php echo JText::_('COM_CONTENTHISTORY_BUTTON_DELETE'); ?></span></button>
</div>
<div class="clearfix"></div>

View File

@ -33,8 +33,8 @@ class ContenthistoryViewPreview extends JViewLegacy
{
$this->state = $this->get('State');
$this->item = $this->get('Item');
if (false === $this->item)
if (false === $this->item)
{
JFactory::getLanguage()->load('com_content', JPATH_SITE, null, true);

View File

@ -11,7 +11,7 @@ defined('_JEXEC') or die;
/**
* Fields Controller
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsController extends JControllerLegacy
{
@ -20,7 +20,7 @@ class FieldsController extends JControllerLegacy
*
* @var string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $default_view = 'fields';
@ -35,7 +35,7 @@ class FieldsController extends JControllerLegacy
*
* @return JControllerLegacy|boolean A JControllerLegacy object to support chaining.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function display($cachable = false, $urlparams = false)
{

View File

@ -13,7 +13,7 @@ use Joomla\Registry\Registry;
/**
* The Field controller
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsControllerField extends JControllerForm
{
@ -26,7 +26,7 @@ class FieldsControllerField extends JControllerForm
*
* @var string
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS_FIELD';
@ -35,7 +35,7 @@ class FieldsControllerField extends JControllerForm
*
* @param array $config A named array of configuration variables.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function __construct($config = array())
{
@ -51,7 +51,7 @@ class FieldsControllerField extends JControllerForm
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function storeform()
{
@ -83,7 +83,7 @@ class FieldsControllerField extends JControllerForm
*
* @return boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function allowAdd($data = array())
{
@ -142,7 +142,7 @@ class FieldsControllerField extends JControllerForm
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function batch($model = null)
{
@ -165,7 +165,7 @@ class FieldsControllerField extends JControllerForm
*
* @return string The arguments to append to the redirect URL.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
{
@ -177,7 +177,7 @@ class FieldsControllerField extends JControllerForm
*
* @return string The arguments to append to the redirect URL.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getRedirectToListAppend()
{
@ -192,7 +192,7 @@ class FieldsControllerField extends JControllerForm
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{

View File

@ -11,7 +11,7 @@ defined('_JEXEC') or die;
/**
* Fields list controller class.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsControllerFields extends JControllerAdmin
{
@ -20,7 +20,7 @@ class FieldsControllerFields extends JControllerAdmin
*
* @var string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS_FIELD';
@ -33,7 +33,7 @@ class FieldsControllerFields extends JControllerAdmin
*
* @return FieldsModelField|boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getModel($name = 'Field', $prefix = 'FieldsModel', $config = array('ignore_request' => true))
{

View File

@ -13,7 +13,7 @@ use Joomla\Registry\Registry;
/**
* The Group controller
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsControllerGroup extends JControllerForm
{
@ -22,7 +22,7 @@ class FieldsControllerGroup extends JControllerForm
*
* @var string
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS_GROUP';
@ -30,7 +30,7 @@ class FieldsControllerGroup extends JControllerForm
* The component for which the group applies.
*
* @var string
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
private $component = '';
@ -39,7 +39,7 @@ class FieldsControllerGroup extends JControllerForm
*
* @param array $config A named array of configuration variables.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function __construct($config = array())
{
@ -60,7 +60,7 @@ class FieldsControllerGroup extends JControllerForm
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function batch($model = null)
{
@ -82,7 +82,7 @@ class FieldsControllerGroup extends JControllerForm
*
* @return boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function allowAdd($data = array())
{
@ -97,7 +97,7 @@ class FieldsControllerGroup extends JControllerForm
*
* @return boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function allowEdit($data = array(), $key = 'parent_id')
{
@ -142,7 +142,7 @@ class FieldsControllerGroup extends JControllerForm
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function postSaveHook(JModelLegacy $model, $validData = array())
{

View File

@ -11,7 +11,7 @@ defined('_JEXEC') or die;
/**
* Groups list controller class.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsControllerGroups extends JControllerAdmin
{
@ -20,7 +20,7 @@ class FieldsControllerGroups extends JControllerAdmin
*
* @var string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS_GROUP';
@ -33,7 +33,7 @@ class FieldsControllerGroups extends JControllerAdmin
*
* @return JModelLegacy|boolean Model object on success; otherwise false on failure.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getModel($name = 'Group', $prefix = 'FieldsModel', $config = array('ignore_request' => true))
{

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="__DEPLOY_VERSION__" method="upgrade">
<extension type="component" version="3.7.0" method="upgrade">
<name>com_fields</name>
<author>Joomla! Project</author>
<creationDate>March 2016</creationDate>
@ -7,7 +7,7 @@
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>__DEPLOY_VERSION__</version>
<version>3.7.0</version>
<description>COM_FIELDS_XML_DESCRIPTION</description>
<files folder="site">
<filename>controller.php</filename>
@ -24,7 +24,6 @@
<folder>helpers</folder>
<folder>libraries</folder>
<folder>models</folder>
<folder>sql</folder>
<folder>tables</folder>
<folder>views</folder>
</files>

View File

@ -8,13 +8,12 @@
*/
defined('_JEXEC') or die;
JLoader::register('FieldsHelperInternal', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/internal.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');
/**
* FieldsHelper
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsHelper
{
@ -30,7 +29,7 @@ class FieldsHelper
*
* @return array|null
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function extract($contextString)
{
@ -41,6 +40,28 @@ class FieldsHelper
return null;
}
$component = $parts[0];
$eName = str_replace('com_', '', $component);
$path = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php');
if (file_exists($path))
{
$cName = ucfirst($eName) . 'Helper';
JLoader::register($cName, $path);
if (class_exists($cName) && is_callable(array($cName, 'validateSection')))
{
$section = call_user_func_array(array($cName, 'validateSection'), array($parts[1]));
if ($section)
{
$parts[1] = $section;
}
}
}
return $parts;
}
@ -62,7 +83,7 @@ class FieldsHelper
*
* @return array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function getFields($context, $item = null, $prepareValue = false, array $valuesToOverride = null)
{
@ -97,7 +118,16 @@ class FieldsHelper
if ($item && (isset($item->catid) || isset($item->fieldscatid)))
{
$assignedCatIds = isset($item->catid) ? $item->catid : $item->fieldscatid;
self::$fieldsCache->setState('filter.assigned_cat_ids', is_array($assignedCatIds) ? $assignedCatIds : explode(',', $assignedCatIds));
if (!is_array($assignedCatIds))
{
$assignedCatIds = explode(',', $assignedCatIds);
}
// Fields without any category assigned should show as well
$assignedCatIds[] = 0;
self::$fieldsCache->setState('filter.assigned_cat_ids', $assignedCatIds);
}
$fields = self::$fieldsCache->getItems();
@ -143,29 +173,25 @@ class FieldsHelper
if ($prepareValue)
{
$value = null;
JPluginHelper::importPlugin('fields');
/*
* On before field prepare
* Event allow plugins to modfify the output of the field before it is prepared
*/
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onFieldBeforePrepare', array($context, $item, &$field));
// Prepare the value from the type layout
$value = self::render($context, 'field.prepare.' . $field->type, array('field' => $field));
// Event allow plugins to modfify the output of the field before it is prepared
$dispatcher->trigger('onCustomFieldsBeforePrepareField', array($context, $item, &$field));
// If the value is empty, render the base layout
if (! $value)
// Gathering the value for the field
$value = $dispatcher->trigger('onCustomFieldsPrepareField', array($context, $item, &$field));
if (is_array($value))
{
$value = self::render($context, 'field.prepare.base', array('field' => $field));
$value = implode($value, ' ');
}
/*
* On after field render
* Event allow plugins to modfify the output of the prepared field
*/
$dispatcher->trigger('onFieldAfterPrepare', array($context, $item, $field, &$value));
// Event allow plugins to modfify the output of the prepared field
$dispatcher->trigger('onCustomFieldsAfterPrepareField', array($context, $item, $field, &$value));
// Assign the value
$field->value = $value;
}
@ -188,7 +214,7 @@ class FieldsHelper
*
* @return NULL|string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function render($context, $layoutFile, $displayData)
{
@ -213,15 +239,6 @@ class FieldsHelper
$value = JLayoutHelper::render($layoutFile, $displayData, null, array('component' => 'com_fields','client' => 0));
}
if ($value == '')
{
// Trying to render the layout of the plugins
foreach (JFolder::listFolderTree(JPATH_PLUGINS . '/fields', '.', 1) as $folder)
{
$value = JLayoutHelper::render($layoutFile, $displayData, $folder['fullname'] . '/layouts');
}
}
return $value;
}
@ -234,7 +251,7 @@ class FieldsHelper
*
* @return boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function prepareForm($context, JForm $form, $data)
{
@ -302,7 +319,7 @@ class FieldsHelper
* Setting the onchange event to reload the page when the category
* has changed
*/
$form->setFieldAttribute('catid', 'onchange', "categoryHasChanged(this);");
$form->setFieldAttribute('catid', 'onchange', 'categoryHasChanged(this);');
JFactory::getDocument()->addScriptDeclaration(
"function categoryHasChanged(element){
var cat = jQuery(element);
@ -325,7 +342,7 @@ class FieldsHelper
return true;
}
FieldsHelperInternal::loadPlugins();
$fieldTypes = self::getFieldTypes();
// Creating the dom
$xml = new DOMDocument('1.0', 'UTF-8');
@ -334,21 +351,32 @@ class FieldsHelper
// Organizing the fields according to their group
$fieldsPerGroup = array(
0 => array()
0 => array()
);
foreach ($fields as $field)
{
if (!array_key_exists($field->type, $fieldTypes))
{
// Field type is not available
continue;
}
if (!array_key_exists($field->group_id, $fieldsPerGroup))
{
$fieldsPerGroup[$field->group_id] = array();
}
if ($path = $fieldTypes[$field->type]['path'])
{
// Add the lookup path for the field
JFormHelper::addFieldPath($path);
}
$fieldsPerGroup[$field->group_id][] = $field;
}
// On the front, sometimes the admin fields path is not included
JFormHelper::addFieldPath(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/fields');
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables');
// Looping trough the groups
@ -414,33 +442,17 @@ class FieldsHelper
// Looping trough the fields for that context
foreach ($groupFields as $field)
{
// Creating the XML form data
$type = JFormHelper::loadFieldType($field->type);
if (!$type)
{
continue;
}
try
{
// Rendering the type
$node = $type->appendXMLFieldTag($field, $fieldset, $form);
if (!FieldsHelperInternal::canEditFieldValue($field))
{
$node->setAttribute('disabled', 'true');
}
JEventDispatcher::getInstance()->trigger('onCustomFieldsPrepareDom', array($field, $fieldset, $form));
/*
*If the field belongs to a assigned_cat_ids but the
* assigned_cat_ids in the data is not known, set the
* required
* flag to false on any circumstance
* If the field belongs to an assigned_cat_id but the assigned_cat_ids in the data
* is not known, set the required flag to false on any circumstance.
*/
if (! $assignedCatids && $field->assigned_cat_ids)
if (! $assignedCatids && $field->assigned_cat_ids && $form->getField($field->alias))
{
$node->setAttribute('required', 'false');
$form->setFieldAttribute($field->alias, 'required', 'false');
}
}
catch (Exception $e)
@ -448,6 +460,12 @@ class FieldsHelper
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
}
// When he field set is empty, then remove it
if (!$fieldset->hasChildNodes())
{
$fieldsNode->removeChild($fieldset);
}
}
// Loading the XML fields string into the form
@ -504,7 +522,7 @@ class FieldsHelper
*
* @return boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function canEditFieldValue($field)
{
@ -520,7 +538,7 @@ class FieldsHelper
*
* @return stdClass[]
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function countItems(&$items)
{
@ -559,12 +577,43 @@ class FieldsHelper
return $items;
}
/**
* Gets assigned categories titles for a field
*
* @param stdClass[] $fieldId The field ID
*
* @return array Array with the assigned categories
*
* @since __DEPLOY_VERSION__
*/
public static function getAssignedCategoriesTitles($fieldId)
{
$fieldId = (int) $fieldId;
if (!$fieldId)
{
return array();
}
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName('c.title'))
->from($db->quoteName('#__fields_categories', 'a'))
->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON a.category_id = c.id')
->where('field_id = ' . $fieldId);
$db->setQuery($query);
return $db->loadColumn();
}
/**
* Gets the fields system plugin extension id.
*
* @return int The fields system plugin extension id.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public static function getFieldsPluginId()
{
@ -588,4 +637,88 @@ class FieldsHelper
return $result;
}
/**
* Configure the Linkbar.
*
* @param string $context The context the fields are used for
* @param string $vName The view currently active
*
* @return void
*
* @since 3.7.0
*/
public static function addSubmenu($context, $vName)
{
$parts = self::extract($context);
if (!$parts)
{
return;
}
$component = $parts[0];
// Avoid nonsense situation.
if ($component == 'com_fields')
{
return;
}
// Try to find the component helper.
$eName = str_replace('com_', '', $component);
$file = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php');
if (!file_exists($file))
{
return;
}
require_once $file;
$cName = ucfirst($eName) . 'Helper';
if (class_exists($cName) && is_callable(array($cName, 'addSubmenu')))
{
$lang = JFactory::getLanguage();
$lang->load($component, JPATH_ADMINISTRATOR)
|| $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component);
$cName::addSubmenu('fields.' . $vName);
}
}
/**
* Loads the fields plugins and returns an array of field types from the plugins.
*
* The returned array contains arrays with the following keys:
* - label: The label of the field
* - type: The type of the field
* - path: The path of the folder where the field can be found
*
* @return array
*
* @since 3.7.0
*/
public static function getFieldTypes()
{
JPluginHelper::importPlugin('fields');
$eventData = JEventDispatcher::getInstance()->trigger('onCustomFieldsGetTypes');
$data = array();
foreach ($eventData as $fields)
{
foreach ($fields as $fieldDescription)
{
if (!array_key_exists('path', $fieldDescription))
{
$fieldDescription['path'] = null;
}
$data[$fieldDescription['type']] = $fieldDescription;
}
}
return $data;
}
}

View File

@ -1,108 +0,0 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');
/**
* Fields component helper.
*
* @since __DEPLOY_VERSION__
*/
class FieldsHelperInternal
{
/**
* Configure the Linkbar.
*
* @param string $context The context the fields are used for
* @param string $vName The view currently active
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public static function addSubmenu ($context, $vName)
{
$parts = FieldsHelper::extract($context);
if (!$parts)
{
return;
}
$component = $parts[0];
// Avoid nonsense situation.
if ($component == 'com_fields')
{
return;
}
// Try to find the component helper.
$eName = str_replace('com_', '', $component);
$file = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/helpers/' . $eName . '.php');
if (!file_exists($file))
{
return;
}
require_once $file;
$cName = ucfirst($eName) . 'Helper';
if (class_exists($cName) && is_callable(array($cName, 'addSubmenu')))
{
$lang = JFactory::getLanguage();
$lang->load($component, JPATH_ADMINISTRATOR)
|| $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component);
$cName::addSubmenu('fields.' . $vName);
}
}
/**
* Return a boolean if the actual logged in user can edit the given field value.
*
* @param stdClass $field The field
*
* @return boolean
*
* @since __DEPLOY_VERSION__
*/
public static function canEditFieldValue($field)
{
$parts = FieldsHelper::extract($field->context);
return JFactory::getUser()->authorise('core.edit.value', $parts[0] . '.field.' . (int) $field->id);
}
/**
* Loads the fields plugins.
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public static function loadPlugins()
{
foreach (JFolder::listFolderTree(JPATH_PLUGINS . '/fields', '.', 1) as $folder)
{
if (!JPluginHelper::isEnabled('fields', $folder['name']))
{
continue;
}
JFactory::getLanguage()->load('plg_fields_' . strtolower($folder['name']), JPATH_ADMINISTRATOR);
JFactory::getLanguage()->load('plg_fields_' . strtolower($folder['name']), $folder['fullname']);
JFormHelper::addFieldPath($folder['fullname'] . '/fields');
}
}
}

View File

@ -0,0 +1,259 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_fields
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Abstract Fields Plugin
*
* @since __DEPLOY_VERSION__
*/
abstract class FieldsPlugin extends JPlugin
{
protected $autoloadLanguage = true;
/**
* Returns the custom fields types.
*
* @return string[][]
*
* @since __DEPLOY_VERSION__
*/
public function onCustomFieldsGetTypes()
{
$types = array();
// The root of the plugin
$root = JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name;
foreach (JFolder::files($root . '/tmpl', '.php') as $layout)
{
// Strip the extension
$layout = str_replace('.php', '', $layout);
// The data array
$data = array();
// The language key
$key = strtoupper($layout);
if ($key != strtoupper($this->_name))
{
$key = strtoupper($this->_name) . '_' . $layout;
}
// Needed attributes
$data['type'] = $layout;
$data['label'] = JText::_('PLG_FIELDS_' . $key . '_LABEL');
$path = $root . '/fields';
// Add the path when it exists
if (file_exists($path))
{
$data['path'] = $path;
}
$types[] = $data;
}
// Return the data
return $types;
}
/**
* Prepares the field value.
*
* @param string $context The context.
* @param stdclass $item The item.
* @param stdclass $field The field.
*
* @return string
*
* @since __DEPLOY_VERSION__
*/
public function onCustomFieldsPrepareField($context, $item, $field)
{
// Check if the field should be processed by us
if (!$this->isTypeSupported($field->type))
{
return;
}
// Merge the params from the plugin and field which has precedence
$fieldParams = clone $this->params;
$fieldParams->merge($field->fieldparams);
// Get the path for the layout file
$path = JPluginHelper::getLayoutPath('fields', $field->type, $field->type);
// Render the layout
ob_start();
include $path;
$output = ob_get_clean();
// Return the output
return $output;
}
/**
* Transforms the field into an XML element and appends it as child on the given parent. This
* is the default implementation of a field. Form fields which do support to be transformed into
* an XML Element mut implemet the JFormDomfieldinterface.
*
* @param stdClass $field The field.
* @param DOMElement $parent The field node parent.
* @param JForm $form The form.
*
* @return DOMElement
*
* @since 3.7.0
*/
public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form)
{
// Check if the field should be processed by us
if (!$this->isTypeSupported($field->type))
{
return null;
}
$app = JFactory::getApplication();
// Detect if the field should be shown at all
if ($field->params->get('show_on') == 1 && $app->isClient('administrator'))
{
return;
}
elseif ($field->params->get('show_on') == 2 && $app->isClient('site'))
{
return null;
}
// Create the node
$node = $parent->appendChild(new DOMElement('field'));
// Set the attributes
$node->setAttribute('name', $field->alias);
$node->setAttribute('type', $field->type);
$node->setAttribute('default', $field->default_value);
$node->setAttribute('label', $field->label);
$node->setAttribute('description', $field->description);
$node->setAttribute('class', $field->params->get('class'));
$node->setAttribute('hint', $field->params->get('hint'));
$node->setAttribute('required', $field->required ? 'true' : 'false');
$node->setAttribute('readonly', $field->params->get('readonly', 0) ? 'true' : 'false');
// Set the disabled state based on the parameter and the permission
if ($field->params->get('disabled', 0))
{
$node->setAttribute('disabled', 'true');
}
// Set the specific field parameters
foreach ($field->fieldparams->toArray() as $key => $param)
{
if ($param === '')
{
// If the param is empty get it from the plugin parameters
$param = $this->params->get($key);
}
if (is_array($param))
{
// Multidimensional arrays (eg. list options) can't be transformed properly
$param = count($param) == count($param, COUNT_RECURSIVE) ? implode(',', $param) : '';
}
if ($param === '')
{
continue;
}
$node->setAttribute($key, $param);
}
// Check if it is allowed to edit the field
if (!FieldsHelper::canEditFieldValue($field))
{
$node->setAttribute('disabled', 'true');
}
// Return the node
return $node;
}
/**
* The form event. Load additional parameters when available into the field form.
* Only when the type of the form is of interest.
*
* @param JForm $form The form
* @param stdClass $data The data
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function onContentPrepareForm(JForm $form, $data)
{
// Check if the field form is calling us
if (strpos($form->getName(), 'com_fields.field') !== 0)
{
return;
}
// Ensure it is an object
$formData = (object) $data;
// Gather the type
$type = $form->getValue('type');
if (!empty($formData->type))
{
$type = $formData->type;
}
// Not us
if (!$this->isTypeSupported($type))
{
return;
}
$path = JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name . '/params/' . $type . '.xml';
// Check if params file exists
if (!file_exists($path))
{
return;
}
// Load the specific plugin parameters
$form->load(file_get_contents($path), true, '/form/*');
}
/**
* Returns true if the given type is supported by the plugin.
*
* @param string $type The type
*
* @return boolean
*
* @since __DEPLOY_VERSION__
*/
protected function isTypeSupported($type)
{
foreach ($this->onCustomFieldsGetTypes() as $typeSpecification)
{
if ($type == $typeSpecification['type'])
{
return true;
}
}
return false;
}
}

View File

@ -15,21 +15,21 @@ use Joomla\Utilities\ArrayHelper;
/**
* Field Model
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsModelField extends JModelAdmin
{
/**
* @var null|string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public $typeAlias = null;
/**
* @var string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $text_prefix = 'COM_FIELDS';
@ -45,7 +45,7 @@ class FieldsModelField extends JModelAdmin
/**
* @var array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
private $valueCache = array();
@ -55,7 +55,7 @@ class FieldsModelField extends JModelAdmin
* @param array $config An optional associative array of configuration settings.
*
* @see JModelLegacy
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function __construct($config = array())
{
@ -71,7 +71,7 @@ class FieldsModelField extends JModelAdmin
*
* @return boolean True on success, False on error.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function save($data)
{
@ -179,7 +179,7 @@ class FieldsModelField extends JModelAdmin
*
* @return mixed Object on success, false on failure.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getItem($pk = null)
{
@ -250,7 +250,7 @@ class FieldsModelField extends JModelAdmin
*
* @return JTable A JTable object
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
* @throws Exception
*/
public function getTable($name = 'Field', $prefix = 'FieldsTable', $options = array())
@ -260,7 +260,11 @@ class FieldsModelField extends JModelAdmin
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables');
}
return JTable::getInstance($name, $prefix, $options);
// Default to text type
$table = JTable::getInstance($name, $prefix, $options);
$table->type = 'text';
return $table;
}
/**
@ -272,7 +276,7 @@ class FieldsModelField extends JModelAdmin
*
* @return array Contains the modified title and alias.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function generateNewTitle($category_id, $alias, $title)
{
@ -298,7 +302,7 @@ class FieldsModelField extends JModelAdmin
*
* @return boolean True if successful, false if an error occurs.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function delete(&$pks)
{
@ -312,12 +316,21 @@ class FieldsModelField extends JModelAdmin
if (!empty($pks))
{
// Delete Values
$query = $this->getDbo()->getQuery(true);
$query->delete($query->qn('#__fields_values'))
->where($query->qn('field_id') . ' IN(' . implode(',', $pks) . ')');
$this->getDbo()->setQuery($query)->execute();
// Delete Assigned Categories
$query = $this->getDbo()->getQuery(true);
$query->delete($query->qn('#__fields_categories'))
->where($query->qn('field_id') . ' IN(' . implode(',', $pks) . ')');
$this->getDbo()->setQuery($query)->execute();
}
}
@ -332,7 +345,7 @@ class FieldsModelField extends JModelAdmin
*
* @return mixed A JForm object on success, false on failure
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getForm($data = array(), $loadData = true)
{
@ -354,12 +367,21 @@ class FieldsModelField extends JModelAdmin
}
}
if (isset($data['type']))
{
// This is needed that the plugins can determine the type
$this->setState('field.type', $data['type']);
}
// Load the fields plugin that they can add additional parameters to the form
JPluginHelper::importPlugin('fields');
// Get the form.
$form = $this->loadForm(
'com_fields.field' . $context, 'field',
array(
'control' => 'jform',
'load_data' => $loadData,
'load_data' => true,
)
);
@ -374,11 +396,6 @@ class FieldsModelField extends JModelAdmin
$data['context'] = $context;
}
if (isset($data['type']))
{
$this->loadTypeForms($form, $data['type']);
}
$fieldId = $jinput->get('id');
$assetKey = $this->state->get('field.component') . '.field.' . $fieldId;
@ -396,31 +413,6 @@ class FieldsModelField extends JModelAdmin
return $form;
}
/**
* Load the form declaration for the type.
*
* @param JForm &$form The form
* @param string $type The type
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
private function loadTypeForms(JForm &$form, $type)
{
FieldsHelperInternal::loadPlugins();
$type = JFormHelper::loadFieldType($type);
// Load all children that's why we need to define the xpath
if (!($type instanceof JFormDomfieldinterface))
{
return;
}
$form->load($type->getFormParameters(), true, '/form/*');
}
/**
* Setting the value for the gven field id, context and item id.
*
@ -431,7 +423,7 @@ class FieldsModelField extends JModelAdmin
*
* @return boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function setFieldValue($fieldId, $context, $itemId, $value)
{
@ -445,7 +437,7 @@ class FieldsModelField extends JModelAdmin
// Don't save the value when the field is disabled or the user is
// not authorized to change it
if (!$field || $params->get('disabled', 0) || !FieldsHelperInternal::canEditFieldValue($field))
if (!$field || $params->get('disabled', 0) || !FieldsHelper::canEditFieldValue($field))
{
return false;
}
@ -537,7 +529,7 @@ class FieldsModelField extends JModelAdmin
*
* @return NULL|string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getFieldValue($fieldId, $context, $itemId)
{
@ -585,7 +577,7 @@ class FieldsModelField extends JModelAdmin
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function cleanupValues($context, $itemId)
{
@ -605,7 +597,7 @@ class FieldsModelField extends JModelAdmin
*
* @return boolean True if allowed to delete the record. Defaults to the permission for the component.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function canDelete($record)
{
@ -632,7 +624,7 @@ class FieldsModelField extends JModelAdmin
* @return boolean True if allowed to change the state of the record. Defaults to the permission for the
* component.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function canEditState($record)
{
@ -653,7 +645,7 @@ class FieldsModelField extends JModelAdmin
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function populateState()
{
@ -685,7 +677,7 @@ class FieldsModelField extends JModelAdmin
*
* @return array An array of conditions to add to ordering queries.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getReorderConditions($table)
{
@ -697,7 +689,7 @@ class FieldsModelField extends JModelAdmin
*
* @return array The default data is an empty array.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function loadFormData()
{
@ -715,21 +707,18 @@ class FieldsModelField extends JModelAdmin
{
// Check for which context the Category Manager is used and
// get selected fields
$context = substr($app->getUserState('com_fields.fields.filter.context'), 4);
$component = FieldsHelper::extract($context);
$component = $component ? $component[0] : null;
$filters = (array) $app->getUserState('com_fields.fields.filter');
$filters = (array) $app->getUserState('com_fields.fields.' . $component . '.filter');
$data->set('published', $app->input->getInt('published', (!empty($filters['published']) ? $filters['published'] : null)));
$data->set('state', $app->input->getInt('state', ((isset($filters['state']) && $filters['state'] !== '') ? $filters['state'] : null)));
$data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));
$data->set('group_id', $app->input->getString('group_id', (!empty($filters['group_id']) ? $filters['group_id'] : null)));
$data->set(
'access',
$app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))
);
// Set the type if available from the request
$data->set('type', $app->input->getWord('type', $data->get('type')));
$data->set('type', $app->input->getWord('type', $this->state->get('field.type', $data->get('type'))));
}
if ($data->label && !isset($data->params['label']))
@ -753,7 +742,7 @@ class FieldsModelField extends JModelAdmin
* @return void
*
* @see JFormField
* @since __DEPLOY_VERSION__
* @since 3.7.0
* @throws Exception if there is an error in the form event.
*/
protected function preprocessForm(JForm $form, $data, $group = 'content')
@ -768,8 +757,6 @@ class FieldsModelField extends JModelAdmin
if (isset($dataObject->type))
{
$this->loadTypeForms($form, $dataObject->type);
$form->setFieldAttribute('type', 'component', $component);
// Not allowed to change the type of an existing record
@ -807,7 +794,7 @@ class FieldsModelField extends JModelAdmin
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function cleanCache($group = null, $client_id = 0)
{
@ -839,7 +826,7 @@ class FieldsModelField extends JModelAdmin
*
* @return array|boolean new IDs if successful, false otherwise and internal error is set.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function batchCopy($value, $pks, $contexts)
{
@ -901,7 +888,7 @@ class FieldsModelField extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function batchMove($value, $pks, $contexts)
{

View File

@ -14,7 +14,7 @@ use Joomla\Utilities\ArrayHelper;
/**
* Fields Model
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsModelFields extends JModelList
{
@ -24,7 +24,7 @@ class FieldsModelFields extends JModelList
* @param array $config An optional associative array of configuration settings.
*
* @see JModelLegacy
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function __construct($config = array())
{
@ -47,6 +47,7 @@ class FieldsModelFields extends JModelList
'category_title',
'category_id', 'a.category_id',
'group_id', 'a.group_id',
'assigned_cat_ids'
);
}
@ -67,7 +68,7 @@ class FieldsModelFields extends JModelList
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function populateState($ordering = null, $direction = null)
{
@ -98,7 +99,7 @@ class FieldsModelFields extends JModelList
*
* @return string A store id.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getStoreId($id = '')
{
@ -118,7 +119,7 @@ class FieldsModelFields extends JModelList
*
* @return JDatabaseQuery A JDatabaseQuery object to retrieve the data set.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getListQuery()
{
@ -177,11 +178,6 @@ class FieldsModelFields extends JModelList
}
}
// Join over the assigned categories
$query->select("GROUP_CONCAT(fc.category_id SEPARATOR ',') AS assigned_cat_ids")
->join('LEFT', $db->quoteName('#__fields_categories') . ' AS fc ON fc.field_id = a.id')
->group('a.id');
if (($categories = $this->getState('filter.assigned_cat_ids')) && $context)
{
$categories = (array) $categories;
@ -215,7 +211,20 @@ class FieldsModelFields extends JModelList
}
}
$query->where('(fc.category_id IS NULL OR fc.category_id IN (' . implode(',', $categories) . '))');
$categories = array_unique($categories);
// Join over the assigned categories
$query->join('LEFT', $db->quoteName('#__fields_categories') . ' AS fc ON fc.field_id = a.id')
->group('a.id, l.title, l.image, uc.name, ag.title, ua.name, g.title, g.access, g.state');
if (in_array('0', $categories))
{
$query->where('(fc.category_id IS NULL OR fc.category_id IN (' . implode(',', $categories) . '))');
}
else
{
$query->where('fc.category_id IN (' . implode(',', $categories) . ')');
}
}
// Implement View Level Access
@ -317,7 +326,7 @@ class FieldsModelFields extends JModelList
*
* @return array An array of results.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
* @throws RuntimeException
*/
protected function _getList($query, $limitstart = 0, $limit = 0)
@ -344,7 +353,7 @@ class FieldsModelFields extends JModelList
*
* @return JForm/false the JForm object or false
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getFilterForm($data = array(), $loadData = true)
{
@ -354,6 +363,7 @@ class FieldsModelFields extends JModelList
{
$form->setValue('context', null, $this->getState('filter.context'));
$form->setFieldAttribute('group_id', 'context', $this->getState('filter.context'), 'filter');
$form->setFieldAttribute('assigned_cat_ids', 'extension', $this->state->get('filter.component'), 'filter');
}
return $form;
@ -364,7 +374,7 @@ class FieldsModelFields extends JModelList
*
* @return array An array of groups
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getGroups()
{
@ -376,7 +386,7 @@ class FieldsModelFields extends JModelList
$query->select('title AS text, id AS value, state');
$query->from('#__fields_groups');
$query->where('state IN (0,1)');
$query->where('context = ' . $db->quote($this->state->get('filter.component')));
$query->where('context = ' . $db->quote($this->state->get('filter.context')));
$query->where('access IN (' . implode(',', $viewlevels) . ')');
$db->setQuery($query);

View File

@ -8,12 +8,14 @@
*/
defined('_JEXEC') or die;
JFormHelper::loadFieldClass('list');
/**
* Fields Contexts
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class JFormFieldFieldcontexts extends JFormAbstractlist
class JFormFieldFieldcontexts extends JFormFieldList
{
public $type = 'Fieldcontexts';
@ -23,7 +25,7 @@ class JFormFieldFieldcontexts extends JFormAbstractlist
*
* @return string The field input markup.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getInput()
{
@ -35,7 +37,7 @@ class JFormFieldFieldcontexts extends JFormAbstractlist
*
* @return array The field option objects.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getOptions()
{

View File

@ -10,12 +10,14 @@ defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
JFormHelper::loadFieldClass('list');
/**
* Fields Groups
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class JFormFieldFieldgroups extends JFormAbstractlist
class JFormFieldFieldgroups extends JFormFieldList
{
public $type = 'Fieldgroups';
@ -24,7 +26,7 @@ class JFormFieldFieldgroups extends JFormAbstractlist
*
* @return array The field option objects.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getOptions()
{

View File

@ -8,12 +8,14 @@
*/
defined('_JEXEC') or die;
JFormHelper::loadFieldClass('list');
/**
* Fields Section
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class JFormFieldSection extends JFormAbstractlist
class JFormFieldSection extends JFormFieldList
{
public $type = 'Section';
@ -28,7 +30,7 @@ class JFormFieldSection extends JFormAbstractlist
*
* @return boolean True on success.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
@ -46,7 +48,7 @@ class JFormFieldSection extends JFormAbstractlist
*
* @return string The field input markup.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getInput ()
{

View File

@ -8,20 +8,17 @@
*/
defined('_JEXEC') or die;
use Joomla\String\StringHelper;
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');
JFormHelper::loadFieldClass('list');
/**
* Fields Type
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class JFormFieldType extends JFormAbstractlist
class JFormFieldType extends JFormFieldList
{
public $type = 'Type';
public static $BLACKLIST = array('moduleposition', 'aliastag');
/**
* Method to attach a JForm object to the field.
*
@ -33,13 +30,13 @@ class JFormFieldType extends JFormAbstractlist
*
* @return boolean True on success.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function setup(SimpleXMLElement $element, $value, $group = null)
{
$return = parent::setup($element, $value, $group);
$this->onchange = "typeHasChanged(this);";
$this->onchange = 'typeHasChanged(this);';
return $return;
}
@ -49,74 +46,17 @@ class JFormFieldType extends JFormAbstractlist
*
* @return array The field option objects.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getOptions()
{
$options = parent::getOptions();
FieldsHelperInternal::loadPlugins();
JFormHelper::addFieldPath(JPATH_LIBRARIES . '/cms/form/field');
$paths = JFormHelper::addFieldPath(JPATH_ADMINISTRATOR . '/components/com_fields/models/fields');
$fieldTypes = FieldsHelper::getFieldTypes();
$component = null;
$parts = FieldsHelper::extract(JFactory::getApplication()->input->get('context'));
if ($parts)
foreach ($fieldTypes as $fieldType)
{
$component = $parts[0];
$paths[] = JPATH_ADMINISTRATOR . '/components/' . $component . '/models/fields';
JFactory::getLanguage()->load($component, JPATH_ADMINISTRATOR);
JFactory::getLanguage()->load($component, JPATH_ADMINISTRATOR . '/components/' . $component);
}
foreach ($paths as $path)
{
if (!JFolder::exists($path))
{
continue;
}
// Looping trough the types
foreach (JFolder::files($path, 'php', true, true) as $filePath)
{
$name = str_replace('.php', '', basename($filePath));
if (in_array(strtolower($name), self::$BLACKLIST))
{
continue;
}
$className = JFormHelper::loadFieldClass($name);
if ($className === false)
{
continue;
}
// Check if the field implements JFormField and JFormDomFieldInterface
if (!is_subclass_of($className, 'JFormField') || !is_subclass_of($className, 'JFormDomfieldinterface'))
{
continue;
}
// Adjust the name
$name = strtolower(str_replace('JFormField', '', $className));
$label = StringHelper::ucfirst($name);
if (JFactory::getLanguage()->hasKey('COM_FIELDS_TYPE_' . strtoupper($name)))
{
$label = 'COM_FIELDS_TYPE_' . strtoupper($name);
}
if ($component && JFactory::getLanguage()->hasKey(strtoupper($component) . '_FIELDS_TYPE_' . strtoupper($name)))
{
$label = strtoupper($component) . '_FIELDS_TYPE_' . strtoupper($name);
}
$options[] = JHtml::_('select.option', $name, JText::_($label));
}
$options[] = JHtml::_('select.option', $fieldType['type'], $fieldType['label']);
}
// Sorting the fields based on the text which is displayed

View File

@ -28,7 +28,7 @@
label="COM_FIELDS_FIELD_GROUP_LABEL"
description="COM_FIELDS_FIELD_GROUP_DESC"
>
<option value=""></option>
<option value="0">JNONE</option>
</field>
<field
@ -225,8 +225,8 @@
<field
name="hint"
type="text"
label="COM_FIELDS_FIELD_HINT_LABEL"
description="COM_FIELDS_FIELD_HINT_DESC"
label="COM_FIELDS_FIELD_PLACEHOLDER_LABEL"
description="COM_FIELDS_FIELD_PLACEHOLDER_DESC"
class="input-xxlarge"
size="40"
/>

View File

@ -33,6 +33,14 @@
<option value="">COM_FIELDS_VIEW_FIELDS_SELECT_GROUP</option>
</field>
<field
name="assigned_cat_ids"
type="category"
onchange="this.form.submit();"
>
<option value="">COM_FIELDS_VIEW_FIELDS_SELECT_CATEGORY</option>
</field>
<field
name="access"
type="accesslevel"

View File

@ -1,5 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset name="group">
<field
name="context"
type="fieldcontexts"
onchange="this.form.submit();"
/>
</fieldset>
<fields name="filter">
<field
name="search"

View File

@ -11,7 +11,7 @@ defined('_JEXEC') or die;
/**
* Group Model
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsModelGroup extends JModelAdmin
{
@ -22,7 +22,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return boolean True on success, False on error.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function save($data)
{
@ -47,7 +47,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return JTable A JTable object
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
* @throws Exception
*/
public function getTable($name = 'Group', $prefix = 'FieldsTable', $options = array())
@ -63,7 +63,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return mixed A JForm object on success, false on failure
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getForm($data = array(), $loadData = true)
{
@ -117,7 +117,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return boolean True if allowed to delete the record. Defaults to the permission for the component.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function canDelete($record)
{
@ -137,7 +137,7 @@ class FieldsModelGroup extends JModelAdmin
* @return boolean True if allowed to change the state of the record. Defaults to the permission for the
* component.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function canEditState($record)
{
@ -160,7 +160,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function populateState()
{
@ -177,7 +177,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return array An array of conditions to add to ordering queries.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getReorderConditions($table)
{
@ -194,7 +194,7 @@ class FieldsModelGroup extends JModelAdmin
* @return void
*
* @see JFormField
* @since __DEPLOY_VERSION__
* @since 3.7.0
* @throws Exception if there is an error in the form event.
*/
protected function preprocessForm(JForm $form, $data, $group = 'content')
@ -215,7 +215,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return array The default data is an empty array.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function loadFormData()
{
@ -261,7 +261,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return mixed Object on success, false on failure.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function getItem($pk = null)
{
@ -310,7 +310,7 @@ class FieldsModelGroup extends JModelAdmin
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function cleanCache($group = null, $client_id = 0)
{

View File

@ -13,7 +13,7 @@ use Joomla\Utilities\ArrayHelper;
/**
* Groups Model
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsModelGroups extends JModelList
{
@ -22,7 +22,7 @@ class FieldsModelGroups extends JModelList
* when dealing with the getStoreId() method and caching data structures.
*
* @var string
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $context = 'com_fields.groups';
@ -32,7 +32,7 @@ class FieldsModelGroups extends JModelList
* @param array $config An optional associative array of configuration settings.
*
* @see JModelLegacy
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function __construct($config = array())
{
@ -71,7 +71,7 @@ class FieldsModelGroups extends JModelList
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function populateState($ordering = null, $direction = null)
{
@ -93,7 +93,7 @@ class FieldsModelGroups extends JModelList
*
* @return string A store id.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getStoreId($id = '')
{
@ -111,7 +111,7 @@ class FieldsModelGroups extends JModelList
*
* @return JDatabaseQuery A JDatabaseQuery object to retrieve the data set.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getListQuery()
{

View File

@ -13,7 +13,7 @@ use Joomla\Registry\Registry;
/**
* Fields Table
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsTableField extends JTable
{
@ -22,7 +22,7 @@ class FieldsTableField extends JTable
*
* @param JDatabaseDriver $db JDatabaseDriver object.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function __construct($db = null)
{
@ -41,7 +41,7 @@ class FieldsTableField extends JTable
*
* @return boolean True on success.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
* @throws InvalidArgumentException
*/
public function bind($src, $ignore = '')
@ -79,7 +79,7 @@ class FieldsTableField extends JTable
* @return boolean True if the instance is sane and able to be stored in the database.
*
* @link https://docs.joomla.org/JTable/check
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function check()
{
@ -110,11 +110,6 @@ class FieldsTableField extends JTable
$this->type = 'text';
}
if (is_array($this->assigned_cat_ids))
{
$this->assigned_cat_ids = implode(',', $this->assigned_cat_ids);
}
$date = JFactory::getDate();
$user = JFactory::getUser();
@ -137,6 +132,11 @@ class FieldsTableField extends JTable
}
}
if (empty($this->group_id))
{
$this->group_id = 0;
}
return true;
}
@ -147,7 +147,7 @@ class FieldsTableField extends JTable
*
* @return string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function _getAssetName()
{
@ -166,7 +166,7 @@ class FieldsTableField extends JTable
* @return string The string to use as the title in the asset table.
*
* @link https://docs.joomla.org/JTable/getAssetTitle
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function _getAssetTitle()
{
@ -177,7 +177,7 @@ class FieldsTableField extends JTable
* Method to get the parent asset under which to register this one.
* By default, all assets are registered to the ROOT node with ID,
* which will default to 1 if none exists.
* The extended class can define a table and id to lookup. If the
* The extended class can define a table and id to lookup. If the
* asset does not exist it will be created.
*
* @param JTable $table A JTable object for the asset parent.
@ -185,7 +185,7 @@ class FieldsTableField extends JTable
*
* @return integer
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{
@ -221,7 +221,7 @@ class FieldsTableField extends JTable
*
* @return number|boolean
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
private function getAssetId($name)
{

View File

@ -13,7 +13,7 @@ use Joomla\Registry\Registry;
/**
* Groups Table
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsTableGroup extends JTable
{
@ -22,7 +22,7 @@ class FieldsTableGroup extends JTable
*
* @param JDatabaseDriver $db JDatabaseDriver object.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function __construct($db = null)
{
@ -41,7 +41,7 @@ class FieldsTableGroup extends JTable
*
* @return boolean True on success.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
* @throws InvalidArgumentException
*/
public function bind($src, $ignore = '')
@ -72,7 +72,7 @@ class FieldsTableGroup extends JTable
* @return boolean True if the instance is sane and able to be stored in the database.
*
* @link https://docs.joomla.org/JTable/check
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function check()
{
@ -115,7 +115,7 @@ class FieldsTableGroup extends JTable
*
* @return string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function _getAssetName()
{
@ -132,7 +132,7 @@ class FieldsTableGroup extends JTable
* @return string The string to use as the title in the asset table.
*
* @link https://docs.joomla.org/JTable/getAssetTitle
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function _getAssetTitle()
{
@ -151,7 +151,7 @@ class FieldsTableGroup extends JTable
*
* @return integer
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function _getAssetParentId(JTable $table = null, $id = null)
{

View File

@ -81,6 +81,8 @@ JFactory::getDocument()->addScriptDeclaration('
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php $this->set('ignore_fieldsets', array('fieldparams')); ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'publishing', JText::_('JGLOBAL_FIELDSET_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
@ -90,8 +92,6 @@ JFactory::getDocument()->addScriptDeclaration('
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php $this->set('ignore_fieldsets', array('fieldparams')); ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'rules', JText::_('JGLOBAL_ACTION_PERMISSIONS_LABEL', true)); ?>
<?php echo $this->form->getInput('rules'); ?>

View File

@ -11,28 +11,28 @@ defined('_JEXEC') or die;
/**
* Field View
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsViewField extends JViewLegacy
{
/**
* @var JForm
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $form;
/**
* @var JObject
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $item;
/**
* @var JObject
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $state;
@ -44,7 +44,7 @@ class FieldsViewField extends JViewLegacy
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::loadTemplate()
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function display($tpl = null)
{
@ -74,7 +74,7 @@ class FieldsViewField extends JViewLegacy
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function addToolbar()
{

View File

@ -141,24 +141,11 @@ if ($saveOrder)
<?php endif; ?>
</span>
<div class="small">
<?php $category = JCategories::getInstance(str_replace('com_', '', $component)); ?>
<?php if ($category) : ?>
<?php $buffer = JText::_('JCATEGORY') . ': '; ?>
<?php $cats = array_filter(explode(',', $item->assigned_cat_ids)); ?>
<?php if (empty($cats)) : ?>
<?php $buffer .= JText::_('JALL'); ?>
<?php endif; ?>
<?php foreach ($cats as $cat) : ?>
<?php if (empty($cat)) : ?>
<?php continue; ?>
<?php endif; ?>
<?php $c = $category->get($cat); ?>
<?php if (!$c || $c->id == 'root') : ?>
<?php continue; ?>
<?php endif; ?>
<?php $buffer .= ' ' . $c->title . ','; ?>
<?php endforeach; ?>
<?php echo trim($buffer, ','); ?>
<?php echo JText::_('JCATEGORY') . ': '; ?>
<?php if ($categories = FieldsHelper::getAssignedCategoriesTitles($item->id)) : ?>
<?php echo implode(', ', $categories); ?>
<?php else: ?>
<?php echo JText::_('JALL'); ?>
<?php endif; ?>
</div>
</div>

View File

@ -30,37 +30,39 @@ JFactory::getDocument()->addScriptDeclaration(
$context = $this->escape($this->state->get('filter.context'));
?>
<div class="row-fluid">
<div class="control-group span6">
<div class="controls">
<?php echo JLayoutHelper::render('joomla.html.batch.language', array()); ?>
</div>
</div>
<div class="control-group span6">
<div class="controls">
<?php echo JLayoutHelper::render('joomla.html.batch.access', array()); ?>
</div>
</div>
</div>
<div class="row-fluid">
<div class="control-group span6">
<div class="controls">
<?php $options = array(
JHtml::_('select.option', 'c', JText::_('JLIB_HTML_BATCH_COPY')),
JHtml::_('select.option', 'm', JText::_('JLIB_HTML_BATCH_MOVE'))
);
?>
<label id="batch-choose-action-lbl" for="batch-choose-action"><?php echo JText::_('COM_FIELDS_BATCH_GROUP_LABEL'); ?></label>
<div id="batch-choose-action" class="control-group">
<select name="batch[group_id]" class="inputbox" id="batch-group-id">
<option value=""><?php echo JText::_('JLIB_HTML_BATCH_NO_CATEGORY'); ?></option>
<option value="nogroup"><?php echo JText::_('COM_FIELDS_BATCH_GROUP_OPTION_NONE'); ?></option>
<?php echo JHtml::_('select.options', $this->get('Groups'), 'value', 'text'); ?>
</select>
<div class="container-fluid">
<div class="row-fluid">
<div class="control-group span6">
<div class="controls">
<?php echo JLayoutHelper::render('joomla.html.batch.language', array()); ?>
</div>
<div id="batch-copy-move" class="control-group radio">
<?php echo JText::_('JLIB_HTML_BATCH_MOVE_QUESTION'); ?>
<?php echo JHtml::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'); ?>
</div>
<div class="control-group span6">
<div class="controls">
<?php echo JLayoutHelper::render('joomla.html.batch.access', array()); ?>
</div>
</div>
</div>
<div class="row-fluid">
<div class="control-group span6">
<div class="controls">
<?php $options = array(
JHtml::_('select.option', 'c', JText::_('JLIB_HTML_BATCH_COPY')),
JHtml::_('select.option', 'm', JText::_('JLIB_HTML_BATCH_MOVE'))
);
?>
<label id="batch-choose-action-lbl" for="batch-choose-action"><?php echo JText::_('COM_FIELDS_BATCH_GROUP_LABEL'); ?></label>
<div id="batch-choose-action" class="control-group">
<select name="batch[group_id]" class="inputbox" id="batch-group-id">
<option value=""><?php echo JText::_('JLIB_HTML_BATCH_NO_CATEGORY'); ?></option>
<option value="nogroup"><?php echo JText::_('COM_FIELDS_BATCH_GROUP_OPTION_NONE'); ?></option>
<?php echo JHtml::_('select.options', $this->get('Groups'), 'value', 'text'); ?>
</select>
</div>
<div id="batch-copy-move" class="control-group radio">
<?php echo JText::_('JLIB_HTML_BATCH_MOVE_QUESTION'); ?>
<?php echo JHtml::_('select.radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'); ?>
</div>
</div>
</div>
</div>

View File

@ -11,49 +11,49 @@ defined('_JEXEC') or die;
/**
* Fields View
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsViewFields extends JViewLegacy
{
/**
* @var JForm
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public $filterForm;
/**
* @var array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public $activeFilters;
/**
* @var array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $items;
/**
* @var JPagination
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $pagination;
/**
* @var JObject
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $state;
/**
* @var string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $sidebar;
@ -65,7 +65,7 @@ class FieldsViewFields extends JViewLegacy
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::loadTemplate()
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function display($tpl = null)
{
@ -92,7 +92,7 @@ class FieldsViewFields extends JViewLegacy
$this->addToolbar();
FieldsHelperInternal::addSubmenu($this->state->get('filter.context'), 'fields');
FieldsHelper::addSubmenu($this->state->get('filter.context'), 'fields');
$this->sidebar = JHtmlSidebar::render();
return parent::display($tpl);
@ -103,7 +103,7 @@ class FieldsViewFields extends JViewLegacy
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function addToolbar()
{
@ -188,7 +188,7 @@ class FieldsViewFields extends JViewLegacy
*
* @return array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getSortFields()
{

View File

@ -11,28 +11,28 @@ defined('_JEXEC') or die;
/**
* Group View
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsViewGroup extends JViewLegacy
{
/**
* @var JForm
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $form;
/**
* @var JObject
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $item;
/**
* @var JObject
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $state;
@ -41,7 +41,7 @@ class FieldsViewGroup extends JViewLegacy
*
* @var JObject
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $canDo;
@ -54,7 +54,7 @@ class FieldsViewGroup extends JViewLegacy
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::loadTemplate()
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function display($tpl = null)
{
@ -92,7 +92,7 @@ class FieldsViewGroup extends JViewLegacy
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function addToolbar()
{

View File

@ -44,6 +44,11 @@ if ($saveOrder)
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<div id="filter-bar" class="js-stools-container-bar pull-left">
<div class="btn-group pull-left">
<?php echo $this->filterForm->getField('context')->input; ?>
</div>&nbsp;
</div>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">

View File

@ -11,15 +11,17 @@ defined('_JEXEC') or die;
JHtml::_('formbehavior.chosen', 'select');
?>
<div class="row-fluid">
<div class="control-group span6">
<div class="controls">
<?php echo JHtml::_('batch.language'); ?>
<div class="container-fluid">
<div class="row-fluid">
<div class="control-group span6">
<div class="controls">
<?php echo JHtml::_('batch.language'); ?>
</div>
</div>
</div>
<div class="control-group span6">
<div class="controls">
<?php echo JHtml::_('batch.access'); ?>
<div class="control-group span6">
<div class="controls">
<?php echo JHtml::_('batch.access'); ?>
</div>
</div>
</div>
</div>

View File

@ -11,49 +11,49 @@ defined('_JEXEC') or die;
/**
* Groups View
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
class FieldsViewGroups extends JViewLegacy
{
/**
* @var JForm
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public $filterForm;
/**
* @var array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public $activeFilters;
/**
* @var array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $items;
/**
* @var JPagination
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $pagination;
/**
* @var JObject
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $state;
/**
* @var string
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected $sidebar;
@ -65,7 +65,7 @@ class FieldsViewGroups extends JViewLegacy
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::loadTemplate()
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
public function display($tpl = null)
{
@ -92,7 +92,7 @@ class FieldsViewGroups extends JViewLegacy
$this->addToolbar();
FieldsHelperInternal::addSubmenu($this->state->get('filter.context'), 'groups');
FieldsHelper::addSubmenu($this->state->get('filter.context'), 'groups');
$this->sidebar = JHtmlSidebar::render();
return parent::display($tpl);
@ -103,7 +103,7 @@ class FieldsViewGroups extends JViewLegacy
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function addToolbar()
{
@ -194,7 +194,7 @@ class FieldsViewGroups extends JViewLegacy
*
* @return array
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
protected function getSortFields()
{

View File

@ -101,19 +101,16 @@ abstract class FinderIndexer
public static function getInstance()
{
// Setup the adapter for the indexer.
$format = JFactory::getDbo()->name;
$serverType = JFactory::getDbo()->getServerType();
if ($format == 'mysqli' || $format == 'pdomysql')
// For `mssql` server types, convert the type to `sqlsrv`
if ($serverType === 'mssql')
{
$format = 'mysql';
}
elseif ($format == 'sqlazure')
{
$format = 'sqlsrv';
$serverType = 'sqlsrv';
}
$path = __DIR__ . '/driver/' . $format . '.php';
$class = 'FinderIndexerDriver' . ucfirst($format);
$path = __DIR__ . '/driver/' . $serverType . '.php';
$class = 'FinderIndexerDriver' . ucfirst($serverType);
// Check if a parser exists for the format.
if (file_exists($path))
@ -125,7 +122,7 @@ abstract class FinderIndexer
}
// Throw invalid format exception.
throw new RuntimeException(JText::sprintf('COM_FINDER_INDEXER_INVALID_DRIVER', $format));
throw new RuntimeException(JText::sprintf('COM_FINDER_INDEXER_INVALID_DRIVER', $serverType));
}
/**
@ -384,7 +381,7 @@ abstract class FinderIndexer
*
* @return integer Cummulative number of tokens extracted from the input so far.
*
* @since __DEPLOY_VERSION__
* @since 3.7.0
*/
private function tokenizeToDbShort($input, $context, $lang, $format, $count)
{

View File

@ -33,7 +33,7 @@ class FinderIndexerParserHtml extends FinderIndexerParser
public function parse($input)
{
// Strip invalid UTF-8 characters.
$input = iconv("utf-8", "utf-8//IGNORE", $input);
$input = iconv('utf-8', 'utf-8//IGNORE', $input);
// Remove anything between <head> and </head> tags. Do this first
// because there might be <script> or <style> tags nested inside.

View File

@ -87,7 +87,7 @@ class FinderIndexerStemmerFr extends FinderIndexerStemmer
. chr(244) . chr(251) . chr(249) . chr(231);
// The rule patterns include all accented words for french language
$vars['rule_pattern'] = "/^([a-z" . $vars['accents'] . "]*)(\*){0,1}(\d)([a-z" . $vars['accents'] . "]*)([.|>])/";
$vars['rule_pattern'] = '/^([a-z' . $vars['accents'] . ']*)(\*){0,1}(\d)([a-z' . $vars['accents'] . ']*)([.|>])/';
// French vowels (including y) in ISO-8859-1 encoding
$vars['vowels'] = chr(97) . chr(224) . chr(226) . chr(101) . chr(232) . chr(233) . chr(234) . chr(235)

View File

@ -9,12 +9,14 @@
defined('JPATH_BASE') or die();
JFormHelper::loadFieldClass('list');
/**
* Search Filter field for the Finder package.
*
* @since 3.5
*/
class JFormFieldBranches extends JFormAbstractlist
class JFormFieldBranches extends JFormFieldList
{
/**
* The form field type.

View File

@ -13,12 +13,14 @@ use Joomla\Utilities\ArrayHelper;
JLoader::register('FinderHelperLanguage', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/language.php');
JFormHelper::loadFieldClass('list');
/**
* Content Types Filter field for the Finder package.
*
* @since 3.6.0
*/
class JFormFieldContentTypes extends JFormAbstractlist
class JFormFieldContentTypes extends JFormFieldList
{
/**
* The form field type.

Some files were not shown because too many files have changed in this diff Show More