typeSupports['state'])) : ?>
-
+
level)) : ?>
$item->level)); ?>
- escape($item->title); ?>
+
+
+ escape($item->title); ?>
+
+ editor, $item->checked_out_time, 'associations.'); ?>
+
+ escape($item->title); ?>
+
+
+ escape($item->title); ?>
+
typeFields['alias'])) : ?>
escape($item->alias)); ?>
diff --git a/administrator/components/com_associations/views/associations/view.html.php b/administrator/components/com_associations/views/associations/view.html.php
index 5c82f82b483d5..ce481471ab11a 100644
--- a/administrator/components/com_associations/views/associations/view.html.php
+++ b/administrator/components/com_associations/views/associations/view.html.php
@@ -69,7 +69,8 @@ public function display($tpl = null)
if (!JLanguageAssociations::isEnabled())
{
- JFactory::getApplication()->enqueueMessage(JText::_('COM_ASSOCIATIONS_ERROR_NO_ASSOC'), 'warning');
+ $link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . AssociationsHelper::getLanguagefilterPluginId());
+ JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_ASSOCIATIONS_ERROR_NO_ASSOC', $link), 'warning');
}
elseif ($this->state->get('itemtype') == '' || $this->state->get('language') == '')
{
diff --git a/administrator/components/com_banners/controllers/tracks.raw.php b/administrator/components/com_banners/controllers/tracks.raw.php
index 146ef47c0bc95..ebf4970d56bf2 100644
--- a/administrator/components/com_banners/controllers/tracks.raw.php
+++ b/administrator/components/com_banners/controllers/tracks.raw.php
@@ -79,12 +79,31 @@ public function display($cachable = false, $urlparams = array())
$model->setState('basename', $form['basename']);
$model->setState('compressed', $form['compressed']);
- $config = JFactory::getConfig();
- $cookie_domain = $config->get('cookie_domain', '');
- $cookie_path = $config->get('cookie_path', '/');
+ // Create one year cookies.
+ $cookieLifeTime = time() + 365 * 86400;
+ $cookieDomain = $app->get('cookie_domain', '');
+ $cookiePath = $app->get('cookie_path', '/');
+ $isHttpsForced = $app->isHttpsForced();
- setcookie(JApplicationHelper::getHash($this->context . '.basename'), $form['basename'], time() + 365 * 86400, $cookie_path, $cookie_domain);
- setcookie(JApplicationHelper::getHash($this->context . '.compressed'), $form['compressed'], time() + 365 * 86400, $cookie_path, $cookie_domain);
+ $app->input->cookie->set(
+ JApplicationHelper::getHash($this->context . '.basename'),
+ $form['basename'],
+ $cookieLifeTime,
+ $cookiePath,
+ $cookieDomain,
+ $isHttpsForced,
+ true
+ );
+
+ $app->input->cookie->set(
+ JApplicationHelper::getHash($this->context . '.compressed'),
+ $form['compressed'],
+ $cookieLifeTime,
+ $cookiePath,
+ $cookieDomain,
+ $isHttpsForced,
+ true
+ );
// Push the model into the view (as default).
$view->setModel($model, true);
diff --git a/administrator/components/com_banners/models/forms/download.xml b/administrator/components/com_banners/models/forms/download.xml
index 0c90b70bc95d4..17c0cc6ec96de 100644
--- a/administrator/components/com_banners/models/forms/download.xml
+++ b/administrator/components/com_banners/models/forms/download.xml
@@ -18,8 +18,8 @@
get('height', 0));
// Sets the width and height to an empty string if = 0
- $registry->set('width', ($width ? $width : ''));
- $registry->set('height', ($height ? $height : ''));
+ $registry->set('width', $width ?: '');
+ $registry->set('height', $height ?: '');
$array['params'] = (string) $registry;
}
diff --git a/administrator/components/com_banners/views/banner/view.html.php b/administrator/components/com_banners/views/banner/view.html.php
index 503ab2b4f03e2..56d98cf202f4c 100644
--- a/administrator/components/com_banners/views/banner/view.html.php
+++ b/administrator/components/com_banners/views/banner/view.html.php
@@ -56,9 +56,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
$this->addToolbar();
diff --git a/administrator/components/com_banners/views/banners/tmpl/default.php b/administrator/components/com_banners/views/banners/tmpl/default.php
index faacb3bfedeba..7965e485af151 100644
--- a/administrator/components/com_banners/views/banners/tmpl/default.php
+++ b/administrator/components/com_banners/views/banners/tmpl/default.php
@@ -111,7 +111,7 @@
+ value="ordering; ?>" class="width-20 text-area-order" />
@@ -156,7 +156,7 @@
client_name; ?>
- impmade, $item->imptotal ? $item->imptotal : JText::_('COM_BANNERS_UNLIMITED')); ?>
+ impmade, $item->imptotal ?: JText::_('COM_BANNERS_UNLIMITED')); ?>
clicks; ?> -
@@ -180,8 +180,8 @@
'bootstrap.renderModal',
'collapseModal',
array(
- 'title' => JText::_('COM_BANNERS_BATCH_OPTIONS'),
- 'footer' => $this->loadTemplate('batch_footer')
+ 'title' => JText::_('COM_BANNERS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer'),
),
$this->loadTemplate('batch_body')
); ?>
diff --git a/administrator/components/com_banners/views/banners/view.html.php b/administrator/components/com_banners/views/banners/view.html.php
index d954cff9ccb0e..0fc752ea058d7 100644
--- a/administrator/components/com_banners/views/banners/view.html.php
+++ b/administrator/components/com_banners/views/banners/view.html.php
@@ -65,9 +65,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
BannersHelper::addSubmenu('banners');
@@ -103,7 +101,7 @@ protected function addToolbar()
JToolbarHelper::addNew('banner.add');
}
- if (($canDo->get('core.edit')))
+ if ($canDo->get('core.edit'))
{
JToolbarHelper::editList('banner.edit');
}
@@ -175,15 +173,15 @@ protected function addToolbar()
protected function getSortFields()
{
return array(
- 'ordering' => JText::_('JGRID_HEADING_ORDERING'),
- 'a.state' => JText::_('JSTATUS'),
- 'a.name' => JText::_('COM_BANNERS_HEADING_NAME'),
- 'a.sticky' => JText::_('COM_BANNERS_HEADING_STICKY'),
+ 'ordering' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.state' => JText::_('JSTATUS'),
+ 'a.name' => JText::_('COM_BANNERS_HEADING_NAME'),
+ 'a.sticky' => JText::_('COM_BANNERS_HEADING_STICKY'),
'client_name' => JText::_('COM_BANNERS_HEADING_CLIENT'),
- 'impmade' => JText::_('COM_BANNERS_HEADING_IMPRESSIONS'),
- 'clicks' => JText::_('COM_BANNERS_HEADING_CLICKS'),
- 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'),
- 'a.id' => JText::_('JGRID_HEADING_ID')
+ 'impmade' => JText::_('COM_BANNERS_HEADING_IMPRESSIONS'),
+ 'clicks' => JText::_('COM_BANNERS_HEADING_CLICKS'),
+ 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'),
+ 'a.id' => JText::_('JGRID_HEADING_ID'),
);
}
}
diff --git a/administrator/components/com_banners/views/client/view.html.php b/administrator/components/com_banners/views/client/view.html.php
index ab0975e8acc1e..f4f0005104af4 100644
--- a/administrator/components/com_banners/views/client/view.html.php
+++ b/administrator/components/com_banners/views/client/view.html.php
@@ -63,9 +63,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
$this->addToolbar();
diff --git a/administrator/components/com_banners/views/clients/tmpl/default.php b/administrator/components/com_banners/views/clients/tmpl/default.php
index ef63cdba1779f..fcf1fb49acee6 100644
--- a/administrator/components/com_banners/views/clients/tmpl/default.php
+++ b/administrator/components/com_banners/views/clients/tmpl/default.php
@@ -27,7 +27,7 @@
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
-$params = (isset($this->state->params)) ? $this->state->params : new JObject;
+$params = isset($this->state->params) ? $this->state->params : new JObject;
?>
- size*1024); ?>
+ size); ?>
diff --git a/administrator/components/com_cache/views/cache/view.html.php b/administrator/components/com_cache/views/cache/view.html.php
index 35e56171b5751..d61cb7927463d 100644
--- a/administrator/components/com_cache/views/cache/view.html.php
+++ b/administrator/components/com_cache/views/cache/view.html.php
@@ -47,9 +47,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
$this->addToolbar();
diff --git a/administrator/components/com_categories/helpers/categories.php b/administrator/components/com_categories/helpers/categories.php
index da87beab3b9da..3103328d8b8a7 100644
--- a/administrator/components/com_categories/helpers/categories.php
+++ b/administrator/components/com_categories/helpers/categories.php
@@ -152,7 +152,7 @@ public static function validateCategoryId($catid, $extension)
*
* @param array $data Array of data for new category.
*
- * @return integer.
+ * @return integer
*/
public static function createCategory($data)
{
diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php
index a684032c74d4c..13b223191dbae 100644
--- a/administrator/components/com_categories/models/category.php
+++ b/administrator/components/com_categories/models/category.php
@@ -480,7 +480,7 @@ public function save($data)
$isNew = true;
$context = $this->option . '.' . $this->name;
- if ((!empty($data['tags']) && $data['tags'][0] != ''))
+ if (!empty($data['tags']) && $data['tags'][0] != '')
{
$table->newTags = $data['tags'];
}
diff --git a/administrator/components/com_categories/models/fields/categoryedit.php b/administrator/components/com_categories/models/fields/categoryedit.php
index be7220b4ab1cf..1df485656d9d3 100644
--- a/administrator/components/com_categories/models/fields/categoryedit.php
+++ b/administrator/components/com_categories/models/fields/categoryedit.php
@@ -41,7 +41,7 @@ class JFormFieldCategoryEdit extends JFormFieldList
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the authorise('core.edit', $extension)
&& $user->authorise('core.edit.state', $extension)) : ?>
JText::_('COM_CATEGORIES_BATCH_OPTIONS'),
- 'footer' => $this->loadTemplate('batch_footer')
- ),
- $this->loadTemplate('batch_body')
- ); ?>
+ 'bootstrap.renderModal',
+ 'collapseModal',
+ array(
+ 'title' => JText::_('COM_CATEGORIES_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer'),
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
diff --git a/administrator/components/com_categories/views/categories/tmpl/modal.php b/administrator/components/com_categories/views/categories/tmpl/modal.php
index 6590314d0bcc2..5c6dc125540d2 100644
--- a/administrator/components/com_categories/views/categories/tmpl/modal.php
+++ b/administrator/components/com_categories/views/categories/tmpl/modal.php
@@ -78,9 +78,9 @@
'icon-trash',
- 0 => 'icon-unpublish',
- 1 => 'icon-publish',
- 2 => 'icon-archive',
+ 0 => 'icon-unpublish',
+ 1 => 'icon-publish',
+ 2 => 'icon-archive',
);
?>
items as $i => $item) : ?>
@@ -107,7 +107,7 @@
?>
-
+
$item->level)); ?>
diff --git a/administrator/components/com_categories/views/categories/view.html.php b/administrator/components/com_categories/views/categories/view.html.php
index f60d332b7af9d..94943883f9314 100644
--- a/administrator/components/com_categories/views/categories/view.html.php
+++ b/administrator/components/com_categories/views/categories/view.html.php
@@ -84,9 +84,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
// Preprocess the list of items to find ordering divisions.
@@ -186,7 +184,7 @@ protected function addToolbar()
// Prepare the toolbar.
JToolbarHelper::title($title, 'folder categories ' . substr($component, 4) . ($section ? "-$section" : '') . '-categories');
- if ($canDo->get('core.create') || (count($user->getAuthorisedCategories($component, 'core.create'))) > 0)
+ if ($canDo->get('core.create') || count($user->getAuthorisedCategories($component, 'core.create')) > 0)
{
JToolbarHelper::addNew('category.add');
}
@@ -277,12 +275,12 @@ protected function addToolbar()
protected function getSortFields()
{
return array(
- 'a.lft' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.lft' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
- 'a.title' => JText::_('JGLOBAL_TITLE'),
- 'a.access' => JText::_('JGRID_HEADING_ACCESS'),
- 'language' => JText::_('JGRID_HEADING_LANGUAGE'),
- 'a.id' => JText::_('JGRID_HEADING_ID')
+ 'a.title' => JText::_('JGLOBAL_TITLE'),
+ 'a.access' => JText::_('JGRID_HEADING_ACCESS'),
+ 'language' => JText::_('JGRID_HEADING_LANGUAGE'),
+ 'a.id' => JText::_('JGRID_HEADING_ID'),
);
}
}
diff --git a/administrator/components/com_categories/views/category/tmpl/edit.xml b/administrator/components/com_categories/views/category/tmpl/edit.xml
index 11d01e0cf8540..f96948e4ad153 100755
--- a/administrator/components/com_categories/views/category/tmpl/edit.xml
+++ b/administrator/components/com_categories/views/category/tmpl/edit.xml
@@ -13,7 +13,7 @@
label="COM_CATEGORIES_CHOOSE_COMPONENT_LABEL"
description="COM_CATEGORIES_CHOOSE_COMPONENT_DESC"
required="true"
- >
+ >
COM_MENUS_OPTION_SELECT_COMPONENT
get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
// Check for tag type
diff --git a/administrator/components/com_checkin/views/checkin/view.html.php b/administrator/components/com_checkin/views/checkin/view.html.php
index 4594dbd113411..2943c79484d5e 100644
--- a/administrator/components/com_checkin/views/checkin/view.html.php
+++ b/administrator/components/com_checkin/views/checkin/view.html.php
@@ -71,9 +71,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
$this->addToolbar();
diff --git a/administrator/components/com_config/model/application.php b/administrator/components/com_config/model/application.php
index 1b3474735037b..17fc3f0fad3da 100644
--- a/administrator/components/com_config/model/application.php
+++ b/administrator/components/com_config/model/application.php
@@ -283,7 +283,7 @@ public function save($data)
* 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'])
+ if (!empty($data['cache_path']))
{
$path = $data['cache_path'];
}
@@ -564,120 +564,101 @@ public function storePermissions($permission = null)
try
{
- // Load the current settings for this component.
- $query = $this->db->getQuery(true)
- ->select($this->db->quoteName(array('name', 'rules')))
- ->from($this->db->quoteName('#__assets'))
- ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component']));
-
- $this->db->setQuery($query);
-
- // Load the results as a list of stdClass objects (see later for more options on retrieving data).
- $results = $this->db->loadAssocList();
- }
- catch (Exception $e)
- {
- $app->enqueueMessage($e->getMessage(), 'error');
-
- return false;
- }
-
- // No record found, let's create one.
- if (empty($results))
- {
- $data = array();
- $data[$permission['action']] = array($permission['rule'] => $permission['value']);
+ $asset = JTable::getInstance('asset');
+ $result = $asset->loadByName($permission['component']);
- $rules = new JAccessRules($data);
- $asset = JTable::getInstance('asset');
- $asset->rules = (string) $rules;
- $asset->name = (string) $permission['component'];
- $asset->title = (string) $permission['title'];
-
- // Get the parent asset id so we have a correct tree.
- $parentAsset = JTable::getInstance('Asset');
-
- if (strpos($asset->name, '.') !== false)
+ if ($result === false)
{
- $assetParts = explode('.', $asset->name);
- $parentAsset->loadByName($assetParts[0]);
- $parentAssetId = $parentAsset->id;
- }
- else
- {
- $parentAssetId = $parentAsset->getRootId();
- }
-
- /**
- * @to do: incorrect ACL stored
- * When changing a permission of an item that doesn't have a row in the asset table the row a new row is created.
- * This works fine for item <-> component <-> global config scenario and component <-> global config scenario.
- * But doesn't work properly for item <-> section(s) <-> component <-> global config scenario,
- * because a wrong parent asset id (the component) is stored.
- * Happens when there is no row in the asset table (ex: deleted or not created on update).
- */
+ $data = array($permission['action'] => array($permission['rule'] => $permission['value']));
- $asset->setLocation($parentAssetId, 'last-child');
-
- if (!$asset->check() || !$asset->store())
- {
- $app->enqueueMessage(JText::_('JLIB_UNKNOWN'), 'error');
+ $rules = new JAccessRules($data);
+ $asset->rules = (string) $rules;
+ $asset->name = (string) $permission['component'];
+ $asset->title = (string) $permission['title'];
- return false;
- }
- }
- else
- {
- // Decode the rule settings.
- $temp = json_decode($results[0]['rules'], true);
+ // Get the parent asset id so we have a correct tree.
+ $parentAsset = JTable::getInstance('Asset');
- // Check if a new value is to be set.
- if (isset($permission['value']))
- {
- // Check if we already have an action entry.
- if (!isset($temp[$permission['action']]))
+ if (strpos($asset->name, '.') !== false)
{
- $temp[$permission['action']] = array();
+ $assetParts = explode('.', $asset->name);
+ $parentAsset->loadByName($assetParts[0]);
+ $parentAssetId = $parentAsset->id;
}
-
- // Check if we already have a rule entry.
- if (!isset($temp[$permission['action']][$permission['rule']]))
+ else
{
- $temp[$permission['action']][$permission['rule']] = array();
+ $parentAssetId = $parentAsset->getRootId();
}
- // Set the new permission.
- $temp[$permission['action']][$permission['rule']] = (int) $permission['value'];
+ /**
+ * @to do: incorrect ACL stored
+ * When changing a permission of an item that doesn't have a row in the asset table the row a new row is created.
+ * This works fine for item <-> component <-> global config scenario and component <-> global config scenario.
+ * But doesn't work properly for item <-> section(s) <-> component <-> global config scenario,
+ * because a wrong parent asset id (the component) is stored.
+ * Happens when there is no row in the asset table (ex: deleted or not created on update).
+ */
- // Check if we have an inherited setting.
- if (strlen($permission['value']) === 0)
- {
- unset($temp[$permission['action']][$permission['rule']]);
- }
+ $asset->setLocation($parentAssetId, 'last-child');
}
else
{
- // There is no value so remove the action as it's not needed.
- unset($temp[$permission['action']]);
- }
+ // Decode the rule settings.
+ $temp = json_decode($asset->rules, true);
- // Store the new permissions.
- try
- {
- $query->clear()
- ->update($this->db->quoteName('#__assets'))
- ->set($this->db->quoteName('rules') . ' = ' . $this->db->quote(json_encode($temp)))
- ->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component']));
+ // Check if a new value is to be set.
+ if (isset($permission['value']))
+ {
+ // Check if we already have an action entry.
+ if (!isset($temp[$permission['action']]))
+ {
+ $temp[$permission['action']] = array();
+ }
+
+ // Check if we already have a rule entry.
+ if (!isset($temp[$permission['action']][$permission['rule']]))
+ {
+ $temp[$permission['action']][$permission['rule']] = array();
+ }
+
+ // Set the new permission.
+ $temp[$permission['action']][$permission['rule']] = (int) $permission['value'];
+
+ // Check if we have an inherited setting.
+ if ($permission['value'] === '')
+ {
+ unset($temp[$permission['action']][$permission['rule']]);
+ }
+
+ // Check if we have any rules.
+ if (!$temp[$permission['action']])
+ {
+ unset($temp[$permission['action']]);
+ }
+ }
+ else
+ {
+ // There is no value so remove the action as it's not needed.
+ unset($temp[$permission['action']]);
+ }
- $this->db->setQuery($query)->execute();
+ $asset->rules = json_encode($temp, JSON_FORCE_OBJECT);
}
- catch (Exception $e)
+
+ if (!$asset->check() || !$asset->store())
{
- $app->enqueueMessage($e->getMessage(), 'error');
+ $app->enqueueMessage(JText::_('JLIB_UNKNOWN'), 'error');
return false;
}
}
+ catch (Exception $e)
+ {
+ $app->enqueueMessage($e->getMessage(), 'error');
+
+ return false;
+ }
+
// All checks done.
$result = array(
@@ -691,7 +672,7 @@ public function storePermissions($permission = null)
try
{
// Get the asset id by the name of the component.
- $query->clear()
+ $query = $this->db->getQuery(true)
->select($this->db->quoteName('id'))
->from($this->db->quoteName('#__assets'))
->where($this->db->quoteName('name') . ' = ' . $this->db->quote($permission['component']));
diff --git a/administrator/components/com_config/model/form/application.xml b/administrator/components/com_config/model/form/application.xml
index 2f965fe43d503..8fda9c7e445fa 100644
--- a/administrator/components/com_config/model/form/application.xml
+++ b/administrator/components/com_config/model/form/application.xml
@@ -7,9 +7,9 @@
@@ -32,7 +32,7 @@
default="1"
showon="cache_handler:memcache"
filter="integer"
- >
+ >
JYES
JNO
@@ -46,7 +46,7 @@
default="0"
showon="cache_handler:memcache"
filter="integer"
- >
+ >
JYES
JNO
@@ -85,7 +85,7 @@
default="1"
showon="cache_handler:memcached"
filter="integer"
- >
+ >
JYES
JNO
@@ -99,7 +99,7 @@
default="0"
showon="cache_handler:memcached"
filter="integer"
- >
+ >
JYES
JNO
@@ -138,7 +138,7 @@
default="1"
filter="integer"
showon="cache_handler:redis"
- >
+ >
JYES
JNO
@@ -211,7 +211,7 @@
class="btn-group btn-group-yesno"
default="0"
filter="integer"
- >
+ >
JYES
JNO
@@ -223,7 +223,7 @@
description="COM_CONFIG_FIELD_CACHE_DESC"
default="2"
filter="integer"
- >
+ >
COM_CONFIG_FIELD_VALUE_CACHE_OFF
COM_CONFIG_FIELD_VALUE_CACHE_CONSERVATIVE
COM_CONFIG_FIELD_VALUE_CACHE_PROGRESSIVE
@@ -282,9 +282,9 @@
@@ -298,12 +298,12 @@
+ >
JYES
JNO
@@ -311,31 +311,29 @@
+ >
JYES
JNO
-
+
+ >
JYES
JNO
@@ -390,8 +388,8 @@
name="ftp_root"
type="text"
label="COM_CONFIG_FIELD_FTP_ROOT_LABEL"
- showon="ftp_enable:1"
description="COM_CONFIG_FIELD_FTP_ROOT_DESC"
+ showon="ftp_enable:1"
filter="string"
size="50"
/>
@@ -405,12 +403,12 @@
+ >
JYES
JNO
@@ -470,10 +468,10 @@
+ default="UTC"
+ >
JLIB_FORM_VALUE_TIMEZONE_UTC
@@ -491,7 +489,7 @@
class="btn-group btn-group-yesno"
default="1"
filter="integer"
- >
+ >
JYES
JNO
@@ -505,7 +503,7 @@
default="0"
filter="integer"
showon="mailonline:1"
- >
+ >
JYES
JNO
@@ -560,7 +558,7 @@
default="mail"
filter="word"
showon="mailonline:1"
- >
+ >
COM_CONFIG_FIELD_VALUE_PHP_MAIL
COM_CONFIG_FIELD_VALUE_SENDMAIL
COM_CONFIG_FIELD_VALUE_SMTP
@@ -612,7 +610,7 @@
default="none"
showon="mailonline:1[AND]mailer:smtp"
filter="word"
- >
+ >
COM_CONFIG_FIELD_VALUE_NONE
COM_CONFIG_FIELD_VALUE_SSL
COM_CONFIG_FIELD_VALUE_TLS
@@ -627,7 +625,7 @@
default="0"
showon="mailonline:1[AND]mailer:smtp"
filter="integer"
- >
+ >
JYES
JNO
@@ -686,7 +684,7 @@
label="JFIELD_METADATA_ROBOTS_LABEL"
description="JFIELD_METADATA_ROBOTS_DESC"
default=""
- >
+ >
JGLOBAL_INDEX_FOLLOW
JGLOBAL_NOINDEX_FOLLOW
JGLOBAL_INDEX_NOFOLLOW
@@ -706,12 +704,12 @@
+ >
JYES
JNO
@@ -719,12 +717,12 @@
+ >
JYES
JNO
@@ -738,12 +736,12 @@
+ >
JYES
JNO
@@ -751,13 +749,13 @@
+ >
JYES
JNO
@@ -765,13 +763,13 @@
+ >
JYES
JNO
@@ -779,13 +777,13 @@
+ >
JYES
JNO
@@ -793,11 +791,11 @@
+ >
COM_CONFIG_FIELD_VALUE_AFTER
COM_CONFIG_FIELD_VALUE_BEFORE
JNO
@@ -821,12 +819,12 @@
+ >
JYES
JNO
@@ -834,11 +832,11 @@
+ >
COM_CONFIG_FIELD_VALUE_SYSTEM_DEFAULT
COM_CONFIG_FIELD_VALUE_NONE
COM_CONFIG_FIELD_VALUE_SIMPLE
@@ -849,11 +847,11 @@
+ >
COM_CONFIG_FIELD_VALUE_NONE
COM_CONFIG_FIELD_VALUE_ADMINISTRATOR_ONLY
COM_CONFIG_FIELD_VALUE_ENTIRE_SITE
@@ -945,7 +943,7 @@
class="btn-group btn-group-yesno"
default="0"
filter="integer"
- >
+ >
JYES
JNO
@@ -969,12 +967,12 @@
+ >
JYES
JNO
@@ -982,12 +980,12 @@
+ >
JHIDE
COM_CONFIG_FIELD_VALUE_DISPLAY_OFFLINE_MESSAGE_CUSTOM
COM_CONFIG_FIELD_VALUE_DISPLAY_OFFLINE_MESSAGE_LANGUAGE
@@ -1015,11 +1013,11 @@
+ >
COM_CONFIG_FRONTEDITING_MENUSANDMODULES
COM_CONFIG_FRONTEDITING_MODULES
JNONE
@@ -1028,42 +1026,42 @@
+ >
JOPTION_DO_NOT_USE
+ >
J5
J10
J15
@@ -1079,11 +1077,11 @@
+ >
J5
J10
J15
@@ -1097,11 +1095,11 @@
+ >
COM_CONFIG_FIELD_VALUE_AUTHOR_EMAIL
COM_CONFIG_FIELD_VALUE_SITE_EMAIL
COM_CONFIG_FIELD_VALUE_NO_EMAIL
@@ -1169,7 +1167,7 @@
translate_label="false"
validate="rules"
filter="rules"
- >
+ >
+
form->getFieldset($name) as $field) : ?>
-
+ type === 'Spacer' ? ' field-spacer' : '';
+ ?>
showon) : ?>
'auto', 'relative' => true)); ?>
@@ -87,7 +90,7 @@
hidden) : ?>
input; ?>
- >
+
>
label; ?>
diff --git a/administrator/components/com_contact/config.xml b/administrator/components/com_contact/config.xml
index 3683321c4073f..3bc8da197b319 100644
--- a/administrator/components/com_contact/config.xml
+++ b/administrator/components/com_contact/config.xml
@@ -112,7 +112,7 @@
>
JSHOW
JHIDE
-
+
JHIDE
+
+ JYES
+ JNO
+
+
getError());
}
+
+ if ($value == 1)
+ {
+ $message = JText::plural('COM_CONTACT_N_ITEMS_FEATURED', count($ids));
+ }
+ else
+ {
+ $message = JText::plural('COM_CONTACT_N_ITEMS_UNFEATURED', count($ids));
+ }
}
- $this->setRedirect('index.php?option=com_contact&view=contacts');
+ $this->setRedirect('index.php?option=com_contact&view=contacts', $message);
}
/**
diff --git a/administrator/components/com_contact/helpers/html/contact.php b/administrator/components/com_contact/helpers/html/contact.php
index aff48320506c3..52a9814fd53df 100644
--- a/administrator/components/com_contact/helpers/html/contact.php
+++ b/administrator/components/com_contact/helpers/html/contact.php
@@ -114,12 +114,13 @@ public static function featured($value = 0, $i, $canChange = true)
if ($canChange)
{
$html = ' ';
+ . ($value == 1 ? ' active' : '') . '" title="' . JHtml::_('tooltipText', $state[3])
+ . '"> ';
}
else
{
- $html = ' ';
+ $html = ' ';
}
return $html;
diff --git a/administrator/components/com_contact/models/contact.php b/administrator/components/com_contact/models/contact.php
index fe10f796b468a..8795988f3aa3e 100644
--- a/administrator/components/com_contact/models/contact.php
+++ b/administrator/components/com_contact/models/contact.php
@@ -52,9 +52,9 @@ class ContactModelContact extends JModelAdmin
*/
protected $batch_commands = array(
'assetgroup_id' => 'batchAccess',
- 'language_id' => 'batchLanguage',
- 'tag' => 'batchTag',
- 'user_id' => 'batchUser'
+ 'language_id' => 'batchLanguage',
+ 'tag' => 'batchTag',
+ 'user_id' => 'batchUser',
);
/**
diff --git a/administrator/components/com_contact/models/forms/contact.xml b/administrator/components/com_contact/models/forms/contact.xml
index f697a5f1cbc4e..397a2099dd30d 100644
--- a/administrator/components/com_contact/models/forms/contact.xml
+++ b/administrator/components/com_contact/models/forms/contact.xml
@@ -60,7 +60,7 @@
id="published"
class="chzn-color-state"
size="1"
- >
+ >
JPUBLISHED
JUNPUBLISHED
JARCHIVED
@@ -530,6 +530,18 @@
JSHOW
+
+ JYES
+ JNO
+
+
JALL
diff --git a/administrator/components/com_contact/models/forms/fields/mail.xml b/administrator/components/com_contact/models/forms/fields/mail.xml
new file mode 100644
index 0000000000000..452bcd4aeb22b
--- /dev/null
+++ b/administrator/components/com_contact/models/forms/fields/mail.xml
@@ -0,0 +1,12 @@
+
+
diff --git a/administrator/components/com_contact/tables/contact.php b/administrator/components/com_contact/tables/contact.php
index 556baa184e63a..5c67d62db63bf 100644
--- a/administrator/components/com_contact/tables/contact.php
+++ b/administrator/components/com_contact/tables/contact.php
@@ -161,7 +161,7 @@ public function check()
}
// Sanity check for user_id
- if (!($this->user_id))
+ if (!$this->user_id)
{
$this->user_id = 0;
}
diff --git a/administrator/components/com_contact/views/contact/view.html.php b/administrator/components/com_contact/views/contact/view.html.php
index de63c695b8827..57d367bf16b4a 100644
--- a/administrator/components/com_contact/views/contact/view.html.php
+++ b/administrator/components/com_contact/views/contact/view.html.php
@@ -54,9 +54,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
// If we are forcing a language in modal (used for associations).
diff --git a/administrator/components/com_contact/views/contacts/tmpl/default.php b/administrator/components/com_contact/views/contacts/tmpl/default.php
index a50ecd75adc81..0883511d7035e 100644
--- a/administrator/components/com_contact/views/contacts/tmpl/default.php
+++ b/administrator/components/com_contact/views/contacts/tmpl/default.php
@@ -115,7 +115,7 @@
+ value="ordering; ?>" class="width-20 text-area-order" />
@@ -187,8 +187,8 @@
'bootstrap.renderModal',
'collapseModal',
array(
- 'title' => JText::_('COM_CONTACT_BATCH_OPTIONS'),
- 'footer' => $this->loadTemplate('batch_footer')
+ 'title' => JText::_('COM_CONTACT_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer'),
),
$this->loadTemplate('batch_body')
); ?>
diff --git a/administrator/components/com_contact/views/contacts/tmpl/modal.php b/administrator/components/com_contact/views/contacts/tmpl/modal.php
index 0b87502a434f5..0553535534f84 100644
--- a/administrator/components/com_contact/views/contacts/tmpl/modal.php
+++ b/administrator/components/com_contact/views/contacts/tmpl/modal.php
@@ -88,9 +88,9 @@
'icon-trash',
- 0 => 'icon-unpublish',
- 1 => 'icon-publish',
- 2 => 'icon-archive',
+ 0 => 'icon-unpublish',
+ 1 => 'icon-publish',
+ 2 => 'icon-archive',
);
?>
items as $i => $item) : ?>
@@ -116,7 +116,7 @@
?>
-
+
diff --git a/administrator/components/com_contact/views/contacts/view.html.php b/administrator/components/com_contact/views/contacts/view.html.php
index 81a2a48b2251c..47bcb57709178 100644
--- a/administrator/components/com_contact/views/contacts/view.html.php
+++ b/administrator/components/com_contact/views/contacts/view.html.php
@@ -81,9 +81,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
// Preprocess the list of items to find ordering divisions.
@@ -135,12 +133,12 @@ protected function addToolbar()
JToolbarHelper::title(JText::_('COM_CONTACT_MANAGER_CONTACTS'), 'address contact');
- if ($canDo->get('core.create') || (count($user->getAuthorisedCategories('com_contact', 'core.create'))) > 0)
+ if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_contact', 'core.create')) > 0)
{
JToolbarHelper::addNew('contact.add');
}
- if (($canDo->get('core.edit')) || ($canDo->get('core.edit.own')))
+ if ($canDo->get('core.edit') || $canDo->get('core.edit.own'))
{
JToolbarHelper::editList('contact.edit');
}
@@ -198,15 +196,15 @@ protected function addToolbar()
protected function getSortFields()
{
return array(
- 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
- 'a.published' => JText::_('JSTATUS'),
- 'a.name' => JText::_('JGLOBAL_TITLE'),
+ 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.name' => JText::_('JGLOBAL_TITLE'),
'category_title' => JText::_('JCATEGORY'),
- 'ul.name' => JText::_('COM_CONTACT_FIELD_LINKED_USER_LABEL'),
- 'a.featured' => JText::_('JFEATURED'),
- 'a.access' => JText::_('JGRID_HEADING_ACCESS'),
- 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'),
- 'a.id' => JText::_('JGRID_HEADING_ID')
+ 'ul.name' => JText::_('COM_CONTACT_FIELD_LINKED_USER_LABEL'),
+ 'a.featured' => JText::_('JFEATURED'),
+ 'a.access' => JText::_('JGRID_HEADING_ACCESS'),
+ 'a.language' => JText::_('JGRID_HEADING_LANGUAGE'),
+ 'a.id' => JText::_('JGRID_HEADING_ID'),
);
}
}
diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml
index d467380a479cb..01b5110bf3dda 100644
--- a/administrator/components/com_content/config.xml
+++ b/administrator/components/com_content/config.xml
@@ -3,10 +3,12 @@
+ description="COM_CONTENT_CONFIG_ARTICLE_SETTINGS_DESC"
+ >
+ >
JSHOW
JHIDE
@@ -28,11 +31,12 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ showon="show_title:1"
+ >
JYES
JNO
@@ -40,10 +44,11 @@
+ >
JSHOW
JHIDE
@@ -51,9 +56,10 @@
+ description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"
+ default="0"
+ >
COM_CONTENT_FIELD_OPTION_ABOVE
COM_CONTENT_FIELD_OPTION_BELOW
COM_CONTENT_FIELD_OPTION_SPLIT
@@ -62,10 +68,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -73,10 +80,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -84,11 +92,12 @@
+ showon="show_category:1"
+ >
JYES
JNO
@@ -96,10 +105,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -107,11 +117,12 @@
+ showon="show_parent_category:1"
+ >
JYES
JNO
@@ -125,11 +136,11 @@
+ >
JSHOW
JHIDE
@@ -137,12 +148,12 @@
+ >
JYES
JNO
@@ -156,10 +167,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -167,11 +179,12 @@
+ showon="show_author:1"
+ >
JYES
JNO
@@ -179,10 +192,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -190,10 +204,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -201,10 +216,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -212,10 +228,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -223,20 +240,23 @@
+ class="btn-group btn-group-yesno"
+ default="0"
+ >
JSHOW
JHIDE
+
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -244,11 +264,12 @@
+ showon="show_readmore:1"
+ >
JSHOW
JHIDE
@@ -263,13 +284,14 @@
/>
+ >
JSHOW
JHIDE
@@ -279,13 +301,15 @@
type="spacer"
hr="true"
/>
+
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -293,10 +317,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -304,10 +329,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -315,10 +341,11 @@
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
@@ -326,107 +353,123 @@
+ >
JYES
JNO
+
+ description="COM_CONTENT_FIELD_URLSPOSITION_DESC"
+ default="0"
+ >
COM_CONTENT_FIELD_OPTION_ABOVE
COM_CONTENT_FIELD_OPTION_BELOW
-
+
+
+
+ >
JOPTION_USE_DEFAULT
JOPTION_DO_NOT_USE
+
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
+
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
+
+ class="btn-group btn-group-yesno"
+ default="0"
+ >
JYES
JNO
+
+
+ class="btn-group btn-group-yesno"
+ default="0"
+ >
JSHOW
JHIDE
+
+ class="btn-group btn-group-yesno"
+ default="0"
+ >
JSHOW
JHIDE
+
+
+ >
JBROWSERTARGET_PARENT
JBROWSERTARGET_NEW
JBROWSERTARGET_POPUP
JBROWSERTARGET_MODAL
+
+ >
JBROWSERTARGET_PARENT
JBROWSERTARGET_NEW
JBROWSERTARGET_POPUP
JBROWSERTARGET_MODAL
+
+ >
JBROWSERTARGET_PARENT
JBROWSERTARGET_NEW
JBROWSERTARGET_POPUP
JBROWSERTARGET_MODAL
+
+ >
COM_CONTENT_RIGHT
COM_CONTENT_LEFT
COM_CONTENT_NONE
+
+ >
COM_CONTENT_RIGHT
COM_CONTENT_LEFT
COM_CONTENT_NONE
@@ -501,65 +548,77 @@
-
+
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
-
+ >
JSHOW
JHIDE
-
+ >
JSHOW
JHIDE
-
+ >
JSHOW
JHIDE
-
+ >
JNONE
JALL
J1
@@ -569,82 +628,92 @@
J5
-
+ >
JSHOW
JHIDE
-
+ >
JSHOW
JHIDE
-
+ class="btn-group btn-group-yesno"
+ >
JSHOW
JHIDE
-
+ >
JSHOW
JHIDE
-
+ >
JSHOW
JHIDE
-
-
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
-
+ description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
+ default="-1"
+ >
JNONE
JALL
J1
@@ -654,101 +723,109 @@
J5
-
+ >
JSHOW
JHIDE
-
+ >
JSHOW
JHIDE
-
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
-
-
-
+ description="JGLOBAL_NUM_LEADING_ARTICLES_DESC"
+ default="1"
+ />
-
-
+ description="JGLOBAL_NUM_INTRO_ARTICLES_DESC"
+ default="4"
+ />
-
-
+ description="JGLOBAL_NUM_COLUMNS_DESC"
+ default="2"
+ />
-
-
+ description="JGLOBAL_NUM_LINKS_DESC"
+ default="4"
+ />
-
- JGLOBAL_DOWN
-
- JGLOBAL_ACROSS
-
+ >
+ JGLOBAL_DOWN
+ JGLOBAL_ACROSS
-
-
+ description="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_DESC"
+ default="0"
+ >
JNONE
JALL
J1
@@ -759,26 +836,32 @@
-
-
+ >
JSHOW
JHIDE
-
+ description="JGLOBAL_FILTER_FIELD_DESC"
+ default="hide"
+ >
JHIDE
JGLOBAL_TITLE
JAUTHOR
@@ -786,181 +869,174 @@
JTAG
-
+ >
JSHOW
JHIDE
-
+ description="JGLOBAL_SHOW_DATE_DESC"
+ default="0"
+ >
JHIDE
JGLOBAL_CREATED
JGLOBAL_MODIFIED
JPUBLISHED
-
-
+ >
JSHOW
JHIDE
-
+ >
JSHOW
JHIDE
-
- JSHOW
- JHIDE
+ description="JGLOBAL_LIST_VOTES_DESC"
+ default="0"
+ >
+ JSHOW
+ JHIDE
-
- JSHOW
- JHIDE
+ description="JGLOBAL_LIST_RATINGS_DESC"
+ default="0"
+ >
+ JSHOW
+ JHIDE
-
-
- JGLOBAL_NO_ORDER
-
- JGLOBAL_TITLE_ALPHABETICAL
-
- JGLOBAL_TITLE_REVERSE_ALPHABETICAL
-
- JGLOBAL_CATEGORY_MANAGER_ORDER
-
-
-
-
+ JGLOBAL_NO_ORDER
+ JGLOBAL_TITLE_ALPHABETICAL
+ JGLOBAL_TITLE_REVERSE_ALPHABETICAL
+ JGLOBAL_CATEGORY_MANAGER_ORDER
+
+
+
- JGLOBAL_MOST_RECENT_FIRST
-
- JGLOBAL_OLDEST_FIRST
-
- JGLOBAL_TITLE_ALPHABETICAL
-
- JGLOBAL_TITLE_REVERSE_ALPHABETICAL
-
- JGLOBAL_AUTHOR_ALPHABETICAL
-
- JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL
-
- JGLOBAL_MOST_HITS
-
- JGLOBAL_LEAST_HITS
-
- JGLOBAL_ARTICLE_MANAGER_ORDER
-
- JGLOBAL_VOTES_DESC
-
- JGLOBAL_VOTES_ASC
-
- JGLOBAL_RATINGS_DESC
-
- JGLOBAL_RATINGS_ASC
-
-
-
-
+ JGLOBAL_MOST_RECENT_FIRST
+ JGLOBAL_OLDEST_FIRST
+ JGLOBAL_TITLE_ALPHABETICAL
+ JGLOBAL_TITLE_REVERSE_ALPHABETICAL
+ JGLOBAL_AUTHOR_ALPHABETICAL
+ JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL
+ JGLOBAL_MOST_HITS
+ JGLOBAL_LEAST_HITS
+ JGLOBAL_ARTICLE_MANAGER_ORDER
+ JGLOBAL_VOTES_DESC
+ JGLOBAL_VOTES_ASC
+ JGLOBAL_RATINGS_DESC
+ JGLOBAL_RATINGS_ASC
+
+
+
+ default="published"
+ >
JGLOBAL_CREATED
JGLOBAL_MODIFIED
JPUBLISHED
-
+ description="JGLOBAL_PAGINATION_DESC"
+ default="2"
+ >
JHIDE
JSHOW
JGLOBAL_AUTO
-
+ >
JSHOW
JHIDE
-
+ default="show"
+ >
JSHOW
JHIDE
JONLY
@@ -968,7 +1044,8 @@
-
@@ -976,10 +1053,11 @@
+ >
JSHOW
JHIDE
@@ -991,24 +1069,20 @@
description="JGLOBAL_FEED_SUMMARY_DESC"
default="0"
showon="show_feed_link:1"
- >
- JGLOBAL_INTRO_TEXT
-
- JGLOBAL_FULL_TEXT
-
+ >
+ JGLOBAL_INTRO_TEXT
+ JGLOBAL_FULL_TEXT
+ >
JSHOW
JHIDE
@@ -1016,11 +1090,11 @@
+ >
JYES
JNO
@@ -1040,6 +1114,7 @@
validate="rules"
filter="rules"
component="com_content"
- section="component"/>
+ section="component"
+ />
diff --git a/administrator/components/com_content/helpers/content.php b/administrator/components/com_content/helpers/content.php
index edd822c453a4c..be806fc1782e1 100644
--- a/administrator/components/com_content/helpers/content.php
+++ b/administrator/components/com_content/helpers/content.php
@@ -40,6 +40,12 @@ public static function addSubmenu($vName)
$vName == 'categories'
);
+ JHtmlSidebar::addEntry(
+ JText::_('COM_CONTENT_SUBMENU_FEATURED'),
+ 'index.php?option=com_content&view=featured',
+ $vName == 'featured'
+ );
+
if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_content')->get('custom_fields_enable', '1'))
{
JHtmlSidebar::addEntry(
@@ -53,12 +59,6 @@ public static function addSubmenu($vName)
$vName == 'fields.groups'
);
}
-
- JHtmlSidebar::addEntry(
- JText::_('COM_CONTENT_SUBMENU_FEATURED'),
- 'index.php?option=com_content&view=featured',
- $vName == 'featured'
- );
}
/**
diff --git a/administrator/components/com_content/helpers/html/contentadministrator.php b/administrator/components/com_content/helpers/html/contentadministrator.php
index b3f7bd06dd9e3..f5e8da1c34520 100644
--- a/administrator/components/com_content/helpers/html/contentadministrator.php
+++ b/administrator/components/com_content/helpers/html/contentadministrator.php
@@ -114,12 +114,13 @@ public static function featured($value = 0, $i, $canChange = true)
if ($canChange)
{
$html = ' ';
+ . ($value == 1 ? ' active' : '') . '" title="' . JHtml::_('tooltipText', $state[3])
+ . '"> ';
}
else
{
$html = ' ';
+ . JHtml::_('tooltipText', $state[2]) . '"> ';
}
return $html;
diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php
index 86daa1e1dae33..b6dba4d0cfefe 100644
--- a/administrator/components/com_content/models/article.php
+++ b/administrator/components/com_content/models/article.php
@@ -414,7 +414,7 @@ public function getForm($data = array(), $loadData = true)
protected function loadFormData()
{
// Check the session for previously entered form data.
- $app = JFactory::getApplication();
+ $app = JFactory::getApplication();
$data = $app->getUserState('com_content.edit.article.data', array());
if (empty($data))
@@ -451,6 +451,38 @@ protected function loadFormData()
return $data;
}
+ /**
+ * Method to validate the form data.
+ *
+ * @param JForm $form The form to validate against.
+ * @param array $data The data to validate.
+ * @param string $group The name of the field group to validate.
+ *
+ * @return array|boolean Array of filtered data if valid, false otherwise.
+ *
+ * @see JFormRule
+ * @see JFilterInput
+ * @since 3.7.0
+ */
+ public function validate($form, $data, $group = null)
+ {
+ // Don't allow to change the users if not allowed to access com_users.
+ if (JFactory::getApplication()->isClient('administrator') && !JFactory::getUser()->authorise('core.manage', 'com_users'))
+ {
+ if (isset($data['created_by']))
+ {
+ unset($data['created_by']);
+ }
+
+ if (isset($data['modified_by']))
+ {
+ unset($data['modified_by']);
+ }
+ }
+
+ return parent::validate($form, $data, $group);
+ }
+
/**
* Method to save the form data.
*
diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php
index dd4606404256a..9cbf323a94948 100644
--- a/administrator/components/com_content/models/articles.php
+++ b/administrator/components/com_content/models/articles.php
@@ -40,6 +40,7 @@ public function __construct($config = array())
'state', 'a.state',
'access', 'a.access', 'access_level',
'created', 'a.created',
+ 'modified', 'a.modified',
'created_by', 'a.created_by',
'created_by_alias', 'a.created_by_alias',
'ordering', 'a.ordering',
@@ -52,7 +53,8 @@ public function __construct($config = array())
'author_id',
'category_id',
'level',
- 'tag'
+ 'tag',
+ 'rating_count', 'rating',
);
if (JLanguageAssociations::isEnabled())
@@ -174,7 +176,7 @@ protected function getListQuery()
$this->getState(
'list.select',
'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid' .
- ', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.ordering, a.featured, a.language, a.hits' .
+ ', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.modified, a.ordering, a.featured, a.language, a.hits' .
', a.publish_up, a.publish_down'
)
);
@@ -322,14 +324,8 @@ protected function getListQuery()
}
// Add the list ordering clause.
- $orderCol = $this->state->get('list.fullordering', 'a.id');
- $orderDirn = '';
-
- if (empty($orderCol))
- {
- $orderCol = $this->state->get('list.ordering', 'a.id');
- $orderDirn = $this->state->get('list.direction', 'DESC');
- }
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'DESC');
$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));
@@ -379,7 +375,7 @@ public function getItems()
{
$groups = JFactory::getUser()->getAuthorisedViewLevels();
- for ($x = 0, $count = count($items); $x < $count; $x++)
+ foreach (array_keys($items) as $x)
{
// Check the access level. Remove articles the user shouldn't see
if (!in_array($items[$x]->access, $groups))
diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php
index 1293c1abacc2a..c66dc0921f4f4 100644
--- a/administrator/components/com_content/models/featured.php
+++ b/administrator/components/com_content/models/featured.php
@@ -55,7 +55,8 @@ public function __construct($config = array())
'author_id',
'category_id',
'level',
- 'tag'
+ 'tag',
+ 'rating_count', 'rating',
);
}
@@ -220,14 +221,8 @@ protected function getListQuery()
}
// Add the list ordering clause.
- $orderCol = $this->state->get('list.fullordering', 'a.title');
- $orderDirn = '';
-
- if (empty($orderCol))
- {
- $orderCol = $this->state->get('list.ordering', 'a.title');
- $orderDirn = $this->state->get('list.direction', 'ASC');
- }
+ $orderCol = $this->state->get('list.ordering', 'a.title');
+ $orderDirn = $this->state->get('list.direction', 'ASC');
$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));
diff --git a/administrator/components/com_content/models/fields/votelist.php b/administrator/components/com_content/models/fields/votelist.php
new file mode 100644
index 0000000000000..c116dbcb8ee28
--- /dev/null
+++ b/administrator/components/com_content/models/fields/votelist.php
@@ -0,0 +1,43 @@
+
-
-
+
+
+
diff --git a/administrator/components/com_content/models/forms/filter_articles.xml b/administrator/components/com_content/models/forms/filter_articles.xml
index 3ac0fcdbbdcc8..e41c8d0d5e00f 100644
--- a/administrator/components/com_content/models/forms/filter_articles.xml
+++ b/administrator/components/com_content/models/forms/filter_articles.xml
@@ -8,6 +8,7 @@
description="COM_CONTENT_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
/>
+
JOPTION_SELECT_PUBLISHED
+
JOPTION_SELECT_CATEGORY
+
JOPTION_SELECT_ACCESS
+
- JOPTION_SELECT_AUTHOR
-
+ name="author_id"
+ type="author"
+ label="COM_CONTENT_FILTER_AUTHOR"
+ description="COM_CONTENT_FILTER_AUTHOR_DESC"
+ onchange="this.form.submit();"
+ >
+ JOPTION_SELECT_AUTHOR
+
+
JOPTION_SELECT_LANGUAGE
JALL
+
+ >
JOPTION_SELECT_TAG
-
- JOPTION_SELECT_MAX_LEVELS
+
+
+ JOPTION_SELECT_MAX_LEVELS
+
JGRID_HEADING_LANGUAGE_DESC
JDATE_ASC
JDATE_DESC
+ COM_CONTENT_MODIFIED_ASC
+ COM_CONTENT_MODIFIED_DESC
COM_CONTENT_PUBLISH_UP_ASC
COM_CONTENT_PUBLISH_UP_DESC
COM_CONTENT_PUBLISH_DOWN_ASC
@@ -123,13 +133,14 @@
JGRID_HEADING_ID_ASC
JGRID_HEADING_ID_DESC
+
diff --git a/administrator/components/com_content/models/forms/filter_featured.xml b/administrator/components/com_content/models/forms/filter_featured.xml
index 2f7f1a9621a33..fe5b19b2a7155 100644
--- a/administrator/components/com_content/models/forms/filter_featured.xml
+++ b/administrator/components/com_content/models/forms/filter_featured.xml
@@ -8,6 +8,7 @@
description="COM_CONTENT_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
/>
+
JOPTION_SELECT_PUBLISHED
+
JOPTION_SELECT_CATEGORY
+
JOPTION_SELECT_ACCESS
+
- JOPTION_SELECT_AUTHOR
-
+ name="author_id"
+ type="author"
+ label="COM_CONTENT_FILTER_AUTHOR"
+ description="COM_CONTENT_FILTER_AUTHOR_DESC"
+ onchange="this.form.submit();"
+ >
+ JOPTION_SELECT_AUTHOR
+
+
JOPTION_SELECT_LANGUAGE
JALL
+
+ >
JOPTION_SELECT_TAG
-
- JOPTION_SELECT_MAX_LEVELS
-
+
+
+ JOPTION_SELECT_MAX_LEVELS
+
+
JGRID_HEADING_ID_ASC
JGRID_HEADING_ID_DESC
+
diff --git a/administrator/components/com_content/views/article/view.html.php b/administrator/components/com_content/views/article/view.html.php
index 4a3154fbb5161..299957ef8902a 100644
--- a/administrator/components/com_content/views/article/view.html.php
+++ b/administrator/components/com_content/views/article/view.html.php
@@ -69,9 +69,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
// If we are forcing a language in modal (used for associations).
diff --git a/administrator/components/com_content/views/articles/tmpl/default.php b/administrator/components/com_content/views/articles/tmpl/default.php
index a06d75f48f795..6afa9bef0fa63 100644
--- a/administrator/components/com_content/views/articles/tmpl/default.php
+++ b/administrator/components/com_content/views/articles/tmpl/default.php
@@ -18,7 +18,7 @@
$app = JFactory::getApplication();
$user = JFactory::getUser();
$userId = $user->get('id');
-$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering'));
+$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'a.ordering';
$columns = 10;
@@ -31,6 +31,10 @@
{
$orderingColumn = 'publish_down';
}
+elseif (strpos($listOrder, 'modified') !== false)
+{
+ $orderingColumn = 'modified';
+}
else
{
$orderingColumn = 'created';
@@ -147,7 +151,7 @@
-
+
@@ -172,11 +176,6 @@
checked_out) : ?>
editor, $item->checked_out_time, 'articles.', $canCheckin); ?>
- language == '*') : ?>
-
-
- language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
-
escape($item->title); ?>
@@ -252,8 +251,8 @@
'bootstrap.renderModal',
'collapseModal',
array(
- 'title' => JText::_('COM_CONTENT_BATCH_OPTIONS'),
- 'footer' => $this->loadTemplate('batch_footer')
+ 'title' => JText::_('COM_CONTENT_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer'),
),
$this->loadTemplate('batch_body')
); ?>
diff --git a/administrator/components/com_content/views/articles/tmpl/modal.php b/administrator/components/com_content/views/articles/tmpl/modal.php
index 686b71450018d..5f524f1d8f554 100644
--- a/administrator/components/com_content/views/articles/tmpl/modal.php
+++ b/administrator/components/com_content/views/articles/tmpl/modal.php
@@ -91,9 +91,9 @@
'icon-trash',
- 0 => 'icon-unpublish',
- 1 => 'icon-publish',
- 2 => 'icon-archive',
+ 0 => 'icon-unpublish',
+ 1 => 'icon-publish',
+ 2 => 'icon-archive',
);
?>
items as $i => $item) : ?>
@@ -119,7 +119,7 @@
?>
-
+
escape($onclick) . '"'
diff --git a/administrator/components/com_content/views/articles/view.html.php b/administrator/components/com_content/views/articles/view.html.php
index 76b97bddcdc3c..5c8ca3ab6fc4d 100644
--- a/administrator/components/com_content/views/articles/view.html.php
+++ b/administrator/components/com_content/views/articles/view.html.php
@@ -90,9 +90,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
// Levels filter - Used in Hathor.
@@ -153,12 +151,12 @@ protected function addToolbar()
JToolbarHelper::title(JText::_('COM_CONTENT_ARTICLES_TITLE'), 'stack article');
- if ($canDo->get('core.create') || (count($user->getAuthorisedCategories('com_content', 'core.create'))) > 0)
+ if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_content', 'core.create')) > 0)
{
JToolbarHelper::addNew('article.add');
}
- if (($canDo->get('core.edit')) || ($canDo->get('core.edit.own')))
+ if ($canDo->get('core.edit') || $canDo->get('core.edit.own'))
{
JToolbarHelper::editList('article.edit');
}
diff --git a/administrator/components/com_content/views/featured/tmpl/default.php b/administrator/components/com_content/views/featured/tmpl/default.php
index 4c41a9168e3b5..cd7c4ed7ff5c3 100644
--- a/administrator/components/com_content/views/featured/tmpl/default.php
+++ b/administrator/components/com_content/views/featured/tmpl/default.php
@@ -17,7 +17,7 @@
$user = JFactory::getUser();
$userId = $user->get('id');
-$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering'));
+$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'fp.ordering';
$columns = 10;
@@ -141,7 +141,7 @@
-
+
@@ -166,11 +166,6 @@
checked_out) : ?>
editor, $item->checked_out_time, 'articles.', $canCheckin); ?>
- language == '*') : ?>
-
-
- language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
-
escape($item->title); ?>
@@ -203,7 +198,8 @@
{$orderingColumn};
echo $date > 0 ? JHtml::_('date', $date, JText::_('DATE_FORMAT_LC4')) : '-';
- ?>
+ ?>
+
hits; ?>
diff --git a/administrator/components/com_content/views/featured/view.html.php b/administrator/components/com_content/views/featured/view.html.php
index 0fbd1bd3aa920..9f2529c9c3c12 100644
--- a/administrator/components/com_content/views/featured/view.html.php
+++ b/administrator/components/com_content/views/featured/view.html.php
@@ -87,9 +87,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
// Levels filter - Used in Hathor.
@@ -172,15 +170,15 @@ protected function addToolbar()
protected function getSortFields()
{
return array(
- 'fp.ordering' => JText::_('JGRID_HEADING_ORDERING'),
- 'a.state' => JText::_('JSTATUS'),
- 'a.title' => JText::_('JGLOBAL_TITLE'),
+ 'fp.ordering' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.state' => JText::_('JSTATUS'),
+ 'a.title' => JText::_('JGLOBAL_TITLE'),
'category_title' => JText::_('JCATEGORY'),
- 'access_level' => JText::_('JGRID_HEADING_ACCESS'),
- 'a.created_by' => JText::_('JAUTHOR'),
- 'language' => JText::_('JGRID_HEADING_LANGUAGE'),
- 'a.created' => JText::_('JDATE'),
- 'a.id' => JText::_('JGRID_HEADING_ID')
+ 'access_level' => JText::_('JGRID_HEADING_ACCESS'),
+ 'a.created_by' => JText::_('JAUTHOR'),
+ 'language' => JText::_('JGRID_HEADING_LANGUAGE'),
+ 'a.created' => JText::_('JDATE'),
+ 'a.id' => JText::_('JGRID_HEADING_ID'),
);
}
}
diff --git a/administrator/components/com_contenthistory/helpers/contenthistory.php b/administrator/components/com_contenthistory/helpers/contenthistory.php
index 5b4d971fdb0f3..2b5801ea75710 100644
--- a/administrator/components/com_contenthistory/helpers/contenthistory.php
+++ b/administrator/components/com_contenthistory/helpers/contenthistory.php
@@ -29,6 +29,11 @@ public static function createObjectArray($object)
{
$result = array();
+ if ($object === null)
+ {
+ return $result;
+ }
+
foreach ($object as $name => $value)
{
$result[$name] = $value;
@@ -289,6 +294,11 @@ public static function mergeLabels($object, $formValues)
{
$result = new stdClass;
+ if ($object === null)
+ {
+ return $result;
+ }
+
$labelsArray = $formValues->labels;
$valuesArray = $formValues->values;
diff --git a/administrator/components/com_contenthistory/helpers/html/textdiff.php b/administrator/components/com_contenthistory/helpers/html/textdiff.php
index 3b34ac97eca50..01906194ec875 100644
--- a/administrator/components/com_contenthistory/helpers/html/textdiff.php
+++ b/administrator/components/com_contenthistory/helpers/html/textdiff.php
@@ -4,7 +4,7 @@
* @subpackage com_contenthistory
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
diff --git a/administrator/components/com_contenthistory/views/compare/view.html.php b/administrator/components/com_contenthistory/views/compare/view.html.php
index 701242388f6a0..d02063defff09 100644
--- a/administrator/components/com_contenthistory/views/compare/view.html.php
+++ b/administrator/components/com_contenthistory/views/compare/view.html.php
@@ -37,9 +37,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
return parent::display($tpl);
diff --git a/administrator/components/com_contenthistory/views/history/tmpl/modal.php b/administrator/components/com_contenthistory/views/history/tmpl/modal.php
index 70da60d755d3a..ce6de9d985568 100644
--- a/administrator/components/com_contenthistory/views/history/tmpl/modal.php
+++ b/administrator/components/com_contenthistory/views/history/tmpl/modal.php
@@ -91,15 +91,15 @@
-
+
authorise('core.manage', 'com_postinstall') && $this->postinstall_message_count) : ?>
diff --git a/administrator/components/com_fields/controllers/field.php b/administrator/components/com_fields/controllers/field.php
index 83b0dbb8979ae..d2205e87d837a 100644
--- a/administrator/components/com_fields/controllers/field.php
+++ b/administrator/components/com_fields/controllers/field.php
@@ -72,7 +72,15 @@ public function storeform()
$app->setUserState($this->input->get('userstatevariable'), $data);
}
- $app->redirect(base64_decode($this->input->get->getBase64('return')));
+ $redirectUrl = base64_decode($this->input->get->getBase64('return'));
+
+ // Don't redirect to an external URL.
+ If (!JUri::isInternal($redirectUrl))
+ {
+ $redirectUrl = 'index.php';
+ }
+
+ $app->redirect($redirectUrl);
$app->close();
}
diff --git a/administrator/components/com_fields/fields.php b/administrator/components/com_fields/fields.php
index ef0dbf01d9c9a..0b806a0d3d4ca 100644
--- a/administrator/components/com_fields/fields.php
+++ b/administrator/components/com_fields/fields.php
@@ -22,7 +22,7 @@
if (!$parts || !JFactory::getUser()->authorise('core.manage', $parts[0]))
{
- return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
+ throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}
$controller = JControllerLegacy::getInstance('Fields');
diff --git a/administrator/components/com_fields/helpers/fields.php b/administrator/components/com_fields/helpers/fields.php
index aedb4666112b0..cc15aa96ae5fb 100644
--- a/administrator/components/com_fields/helpers/fields.php
+++ b/administrator/components/com_fields/helpers/fields.php
@@ -277,6 +277,8 @@ public static function prepareForm($context, JForm $form, $data)
return true;
}
+ $context = $parts[0] . '.' . $parts[1];
+
// When no fields available return here
$fields = self::getFields($parts[0] . '.' . $parts[1], new JObject);
@@ -403,10 +405,13 @@ function categoryHasChanged(element) {
// On the front, sometimes the admin fields path is not included
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/tables');
+ $model = JModelLegacy::getInstance('Groups', 'FieldsModel', array('ignore_request' => true));
+ $model->setState('filter.context', $context);
+
// Looping through the groups
- foreach ($fieldsPerGroup as $group_id => $groupFields)
+ foreach ($model->getItems() as $group)
{
- if (!$groupFields)
+ if (empty($fieldsPerGroup[$group->id]))
{
continue;
}
@@ -414,49 +419,32 @@ function categoryHasChanged(element) {
// Defining the field set
/** @var DOMElement $fieldset */
$fieldset = $fieldsNode->appendChild(new DOMElement('fieldset'));
- $fieldset->setAttribute('name', 'fields-' . $group_id);
+ $fieldset->setAttribute('name', 'fields-' . $group->id);
$fieldset->setAttribute('addfieldpath', '/administrator/components/' . $component . '/models/fields');
$fieldset->setAttribute('addrulepath', '/administrator/components/' . $component . '/models/rules');
- $label = '';
- $description = '';
+ $label = $group->title;
+ $description = $group->description;
- if ($group_id)
+ if (!$label)
{
- $group = JTable::getInstance('Group', 'FieldsTable');
- $group->load($group_id);
+ $key = strtoupper($component . '_FIELDS_' . $section . '_LABEL');
- if ($group->id)
+ if (!JFactory::getLanguage()->hasKey($key))
{
- $label = $group->title;
- $description = $group->description;
+ $key = 'JGLOBAL_FIELDS';
}
+
+ $label = $key;
}
- if (!$label || !$description)
+ if (!$description)
{
- $lang = JFactory::getLanguage();
+ $key = strtoupper($component . '_FIELDS_' . $section . '_DESC');
- if (!$label)
+ if (JFactory::getLanguage()->hasKey($key))
{
- $key = strtoupper($component . '_FIELDS_' . $section . '_LABEL');
-
- if (!$lang->hasKey($key))
- {
- $key = 'JGLOBAL_FIELDS';
- }
-
- $label = $key;
- }
-
- if (!$description)
- {
- $key = strtoupper($component . '_FIELDS_' . $section . '_DESC');
-
- if ($lang->hasKey($key))
- {
- $description = $key;
- }
+ $description = $key;
}
}
@@ -464,11 +452,11 @@ function categoryHasChanged(element) {
$fieldset->setAttribute('description', strip_tags($description));
// Looping through the fields for that context
- foreach ($groupFields as $field)
+ foreach ($fieldsPerGroup[$group->id] as $field)
{
try
{
- JEventDispatcher::getInstance()->trigger('onCustomFieldsPrepareDom', array($field, $fieldset, $form));
+ JFactory::getApplication()->triggerEvent('onCustomFieldsPrepareDom', array($field, $fieldset, $form));
/*
* If the field belongs to an assigned_cat_id but the assigned_cat_ids in the data
diff --git a/administrator/components/com_fields/libraries/fieldslistplugin.php b/administrator/components/com_fields/libraries/fieldslistplugin.php
index 92f9cb83dc54e..2074010440035 100644
--- a/administrator/components/com_fields/libraries/fieldslistplugin.php
+++ b/administrator/components/com_fields/libraries/fieldslistplugin.php
@@ -41,8 +41,8 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form
foreach ($this->getOptionsFromField($field) as $value => $name)
{
- $option = new DOMElement('option', htmlentities($value));
- $option->nodeValue = htmlentities(JText::_($name));
+ $option = new DOMElement('option', htmlspecialchars($value, ENT_COMPAT, 'UTF-8'));
+ $option->nodeValue = htmlspecialchars(JText::_($name), ENT_COMPAT, 'UTF-8');
$element = $fieldNode->appendChild($option);
$element->setAttribute('value', $value);
diff --git a/administrator/components/com_fields/libraries/fieldsplugin.php b/administrator/components/com_fields/libraries/fieldsplugin.php
index f5d9c1973079b..84eca9a148988 100644
--- a/administrator/components/com_fields/libraries/fieldsplugin.php
+++ b/administrator/components/com_fields/libraries/fieldsplugin.php
@@ -166,13 +166,6 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form
$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');
- }
// Combine the two params
$params = clone $this->params;
diff --git a/administrator/components/com_fields/models/field.php b/administrator/components/com_fields/models/field.php
index 6dcb19fc63622..ce320dc5aaafc 100644
--- a/administrator/components/com_fields/models/field.php
+++ b/administrator/components/com_fields/models/field.php
@@ -109,7 +109,7 @@ public function save($data)
if ($data['title'] == $origTable->title)
{
- list($title, $name) = $this->generateNewTitle($data['group_id'], $data['alias'], $data['title']);
+ list($title, $name) = $this->generateNewTitle($data['group_id'], $data['name'], $data['title']);
$data['title'] = $title;
$data['label'] = $title;
$data['name'] = $name;
@@ -565,9 +565,8 @@ public function setFieldValue($fieldId, $itemId, $value)
$params = new Registry($params);
}
- // 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) || !FieldsHelper::canEditFieldValue($field))
+ // Don't save the value when the user is not authorized to change it
+ if (!$field || !FieldsHelper::canEditFieldValue($field))
{
return false;
}
@@ -921,6 +920,7 @@ protected function loadFormData()
protected function preprocessForm(JForm $form, $data, $group = 'content')
{
$component = $this->state->get('field.component');
+ $section = $this->state->get('field.section');
$dataObject = $data;
if (is_array($dataObject))
@@ -968,6 +968,21 @@ protected function preprocessForm(JForm $form, $data, $group = 'content')
$form->setFieldAttribute('group_id', 'context', $this->state->get('field.context'));
$form->setFieldAttribute('rules', 'component', $component);
+ // Looking first in the component models/forms folder
+ $path = JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component . '/models/forms/fields/' . $section . '.xml');
+
+ if (file_exists($path))
+ {
+ $lang = JFactory::getLanguage();
+ $lang->load($component, JPATH_BASE, null, false, true);
+ $lang->load($component, JPATH_BASE . '/components/' . $component, null, false, true);
+
+ if (!$form->loadFile($path, false))
+ {
+ throw new Exception(JText::_('JERROR_LOADFILE_FAILED'));
+ }
+ }
+
// Trigger the default form events.
parent::preprocessForm($form, $data, $group);
}
diff --git a/administrator/components/com_fields/models/fields.php b/administrator/components/com_fields/models/fields.php
index 91f043aef0a7f..56620b66212b8 100644
--- a/administrator/components/com_fields/models/fields.php
+++ b/administrator/components/com_fields/models/fields.php
@@ -228,7 +228,7 @@ protected function getListQuery()
}
// Implement View Level Access
- if (!$user->authorise('core.admin'))
+ if (!$app->isClient('administrator') || !$user->authorise('core.admin'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ') AND (a.group_id = 0 OR g.access IN (' . $groups . '))');
@@ -302,15 +302,9 @@ protected function getListQuery()
}
// Add the list ordering clause
- $listOrdering = $this->getState('list.fullordering', 'a.ordering');
- $orderDirn = '';
+ $listOrdering = $this->state->get('list.ordering', 'a.ordering');
+ $orderDirn = $this->state->get('list.direction', 'ASC');
- if (empty($listOrdering))
- {
- $listOrdering = $this->state->get('list.ordering', 'a.ordering');
- $orderDirn = $this->state->get('list.direction', 'DESC');
- }
-
$query->order($db->escape($listOrdering) . ' ' . $db->escape($orderDirn));
return $query;
@@ -350,7 +344,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
* @param array $data data
* @param boolean $loadData load current data
*
- * @return JForm/false the JForm object or false
+ * @return JForm|false the JForm object or false
*
* @since 3.7.0
*/
diff --git a/administrator/components/com_fields/models/fields/fieldgroups.php b/administrator/components/com_fields/models/fields/fieldgroups.php
index 0adac1584a04a..cf92647ed746b 100644
--- a/administrator/components/com_fields/models/fields/fieldgroups.php
+++ b/administrator/components/com_fields/models/fields/fieldgroups.php
@@ -31,7 +31,7 @@ class JFormFieldFieldgroups extends JFormFieldList
protected function getOptions()
{
$context = (string) $this->element['context'];
- $states = $this->element['state'] ? $this->element['state'] : '0,1';
+ $states = $this->element['state'] ?: '0,1';
$states = ArrayHelper::toInteger(explode(',', $states));
$user = JFactory::getUser();
@@ -44,6 +44,7 @@ protected function getOptions()
$query->where('state IN (' . implode(',', $states) . ')');
$query->where('context = ' . $db->quote($context));
$query->where('access IN (' . implode(',', $viewlevels) . ')');
+ $query->order('ordering asc, id asc');
$db->setQuery($query);
$options = $db->loadObjectList();
diff --git a/administrator/components/com_fields/models/fields/section.php b/administrator/components/com_fields/models/fields/section.php
index 4d74202c1d61b..9532ac633c485 100644
--- a/administrator/components/com_fields/models/fields/section.php
+++ b/administrator/components/com_fields/models/fields/section.php
@@ -24,7 +24,7 @@ class JFormFieldSection extends JFormFieldList
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object.
* @param mixed $value The form field value to validate.
- * @param string $group The field name group control value. This acts as as an array container for the field.
+ * @param string $group The field name group control value. This acts as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
*
diff --git a/administrator/components/com_fields/models/fields/type.php b/administrator/components/com_fields/models/fields/type.php
index 054fb68b9b9f0..aa24240595cdb 100644
--- a/administrator/components/com_fields/models/fields/type.php
+++ b/administrator/components/com_fields/models/fields/type.php
@@ -24,7 +24,7 @@ class JFormFieldType extends JFormFieldList
*
* @param SimpleXMLElement $element The SimpleXMLElement object representing the `` tag for the form field object.
* @param mixed $value The form field value to validate.
- * @param string $group The field name group control value. This acts as as an array container for the field.
+ * @param string $group The field name group control value. This acts as an array container for the field.
* For example if the field has name="foo" and the group value is set to "bar" then the
* full field name would end up being "bar[foo]".
*
diff --git a/administrator/components/com_fields/models/forms/field.xml b/administrator/components/com_fields/models/forms/field.xml
index 69398da5f8f29..0e2e105937d8c 100644
--- a/administrator/components/com_fields/models/forms/field.xml
+++ b/administrator/components/com_fields/models/forms/field.xml
@@ -4,9 +4,9 @@
@@ -27,7 +27,7 @@
type="fieldgroups"
label="COM_FIELDS_FIELD_GROUP_LABEL"
description="COM_FIELDS_FIELD_GROUP_DESC"
- >
+ >
JNONE
@@ -35,10 +35,10 @@
name="assigned_cat_ids"
type="category"
label="JCATEGORY"
- extension="com_content"
description="JFIELD_FIELDS_CATEGORY_DESC"
+ extension="com_content"
multiple="true"
- >
+ >
JALL
@@ -65,19 +65,19 @@
name="type"
type="type"
label="COM_FIELDS_FIELD_TYPE_LABEL"
- default="text"
description="COM_FIELDS_FIELD_TYPE_DESC"
+ default="text"
required="true"
/>
+ class="btn-group btn-group-yesno"
+ default="0"
+ >
JYES
JNO
@@ -85,20 +85,20 @@
+ >
JPUBLISHED
JUNPUBLISHED
JARCHIVED
@@ -107,9 +107,9 @@
+ >
JALL
@@ -189,8 +189,8 @@
name="description"
type="textarea"
label="JGLOBAL_DESCRIPTION"
- size="40"
description="COM_FIELDS_FIELD_DESCRIPTION_DESC"
+ size="40"
filter="HTML"
/>
@@ -202,10 +202,10 @@
/>
+
+ class="btn-group btn-group-yesno"
+ default="1"
+ >
JSHOW
JHIDE
-
- JYES
- JNO
-
-
-
- JYES
- JNO
-
-
+ class="btn-group btn-group-yesno"
+ default=""
+ >
COM_FIELDS_FIELD_SHOW_ON_SITE
COM_FIELDS_FIELD_SHOW_ON_ADMIN
COM_FIELDS_FIELD_SHOW_ON_BOTH
@@ -304,7 +281,7 @@
label="COM_FIELDS_FIELD_DISPLAY_LABEL"
description="COM_FIELDS_FIELD_DISPLAY_DESC"
default="2"
- >
+ >
COM_FIELDS_FIELD_DISPLAY_AFTER_TITLE
COM_FIELDS_FIELD_DISPLAY_BEFORE_DISPLAY
COM_FIELDS_FIELD_DISPLAY_AFTER_DISPLAY
diff --git a/administrator/components/com_fields/models/forms/filter_fields.xml b/administrator/components/com_fields/models/forms/filter_fields.xml
index be53abbe5cea9..aca47a63e508b 100644
--- a/administrator/components/com_fields/models/forms/filter_fields.xml
+++ b/administrator/components/com_fields/models/forms/filter_fields.xml
@@ -20,7 +20,7 @@
name="state"
type="status"
onchange="this.form.submit();"
- >
+ >
JOPTION_SELECT_PUBLISHED
@@ -45,7 +45,7 @@
name="access"
type="accesslevel"
onchange="this.form.submit();"
- >
+ >
JOPTION_SELECT_ACCESS
@@ -53,7 +53,7 @@
name="language"
type="contentlanguage"
onchange="this.form.submit();"
- >
+ >
JOPTION_SELECT_LANGUAGE
@@ -63,11 +63,11 @@
name="fullordering"
type="list"
label="JGLOBAL_SORT_BY"
- statuses="*,0,1,2,-2"
description="JGLOBAL_SORT_BY"
+ statuses="*,0,1,2,-2"
onchange="this.form.submit();"
default="a.ordering ASC"
- >
+ >
JGLOBAL_SORT_BY
JGRID_HEADING_ORDERING_ASC
JGRID_HEADING_ORDERING_DESC
@@ -90,9 +90,10 @@
diff --git a/administrator/components/com_fields/models/forms/group.xml b/administrator/components/com_fields/models/forms/group.xml
index d4e4e114368d3..575054f15fd23 100644
--- a/administrator/components/com_fields/models/forms/group.xml
+++ b/administrator/components/com_fields/models/forms/group.xml
@@ -41,7 +41,7 @@
description="JFIELD_PUBLISHED_DESC"
class="chzn-color-state"
default="1"
- >
+ >
JPUBLISHED
JUNPUBLISHED
JARCHIVED
@@ -74,7 +74,7 @@
name="created_by"
type="user"
label="JGLOBAL_FIELD_CREATED_BY_LABEL"
- desc="JGLOBAL_FIELD_CREATED_BY_DESC"
+ description="JGLOBAL_FIELD_CREATED_BY_DESC"
/>
-
diff --git a/administrator/components/com_fields/models/groups.php b/administrator/components/com_fields/models/groups.php
index beb82f0d2ad4b..bf0edd52e1685 100644
--- a/administrator/components/com_fields/models/groups.php
+++ b/administrator/components/com_fields/models/groups.php
@@ -121,13 +121,7 @@ protected function getListQuery()
$user = JFactory::getUser();
// Select the required fields from the table.
- $query->select(
- $this->getState(
- 'list.select',
- 'a.id, a.title, a.checked_out, a.checked_out_time, a.note' .
- ', a.state, a.access, a.created, a.created_by, a.ordering, a.language'
- )
- );
+ $query->select($this->getState('list.select', 'a.*'));
$query->from('#__fields_groups AS a');
// Join over the language
diff --git a/administrator/components/com_fields/tables/field.php b/administrator/components/com_fields/tables/field.php
index 0d64971277bee..452e4398b1fa9 100644
--- a/administrator/components/com_fields/tables/field.php
+++ b/administrator/components/com_fields/tables/field.php
@@ -78,7 +78,7 @@ public function bind($src, $ignore = '')
*
* @return boolean True if the instance is sane and able to be stored in the database.
*
- * @link https://docs.joomla.org/JTable/check
+ * @link https://docs.joomla.org/Special:MyLanguage/JTable/check
* @since 3.7.0
*/
public function check()
@@ -177,7 +177,7 @@ protected function _getAssetName()
*
* @return string The string to use as the title in the asset table.
*
- * @link https://docs.joomla.org/JTable/getAssetTitle
+ * @link https://docs.joomla.org/Special:MyLanguage/JTable/getAssetTitle
* @since 3.7.0
*/
protected function _getAssetTitle()
diff --git a/administrator/components/com_fields/tables/group.php b/administrator/components/com_fields/tables/group.php
index ec160ddc46336..200231e56a3da 100644
--- a/administrator/components/com_fields/tables/group.php
+++ b/administrator/components/com_fields/tables/group.php
@@ -71,7 +71,7 @@ public function bind($src, $ignore = '')
*
* @return boolean True if the instance is sane and able to be stored in the database.
*
- * @link https://docs.joomla.org/JTable/check
+ * @link https://docs.joomla.org/Special:MyLanguage/JTable/check
* @since 3.7.0
*/
public function check()
@@ -133,7 +133,7 @@ protected function _getAssetName()
*
* @return string The string to use as the title in the asset table.
*
- * @link https://docs.joomla.org/JTable/getAssetTitle
+ * @link https://docs.joomla.org/Special:MyLanguage/JTable/getAssetTitle
* @since 3.7.0
*/
protected function _getAssetTitle()
diff --git a/administrator/components/com_fields/views/field/view.html.php b/administrator/components/com_fields/views/field/view.html.php
index 32f5c449f7cb8..8c7940a725a80 100644
--- a/administrator/components/com_fields/views/field/view.html.php
+++ b/administrator/components/com_fields/views/field/view.html.php
@@ -57,9 +57,7 @@ public function display($tpl = null)
// Check for errors.
if (count($errors = $this->get('Errors')))
{
- JError::raiseError(500, implode("\n", $errors));
-
- return false;
+ throw new Exception(implode("\n", $errors), 500);
}
JFactory::getApplication()->input->set('hidemainmenu', true);
diff --git a/administrator/components/com_fields/views/fields/tmpl/default.php b/administrator/components/com_fields/views/fields/tmpl/default.php
index e05c47f302200..cb96ce15463ad 100644
--- a/administrator/components/com_fields/views/fields/tmpl/default.php
+++ b/administrator/components/com_fields/views/fields/tmpl/default.php
@@ -20,7 +20,7 @@
$userId = $user->get('id');
$context = $this->escape($this->state->get('filter.context'));
$component = $this->state->get('filter.component');
-$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering'));
+$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$ordering = ($listOrder == 'a.ordering');
$saveOrder = ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc');
diff --git a/administrator/components/com_fields/views/fields/tmpl/modal.php b/administrator/components/com_fields/views/fields/tmpl/modal.php
index d4ddd216f03c4..49d63ab82dfeb 100644
--- a/administrator/components/com_fields/views/fields/tmpl/modal.php
+++ b/administrator/components/com_fields/views/fields/tmpl/modal.php
@@ -17,6 +17,7 @@
JHtml::_('behavior.core');
JHtml::_('bootstrap.tooltip', '.hasTooltip', array('placement' => 'bottom'));
JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('script', 'com_fields/admin-fields-modal.js', array('version' => 'auto', 'relative' => true));
// Special case for the search field tooltip.
$searchFilterDesc = $this->filterForm->getFieldAttribute('search', 'description', null, 'filter');
@@ -25,16 +26,6 @@
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$editor = JFactory::getApplication()->input->get('editor', '', 'cmd');
-
-JFactory::getDocument()->addScriptDeclaration('
-fieldIns = function(id) {
- window.parent.jInsertEditorText("{field " + id + "}", "' . $editor . '");
- window.parent.jModalClose();
-};
-fieldgroupIns = function(id) {
- window.parent.jInsertEditorText("{fieldgroup " + id + "}", "' . $editor . '");
- window.parent.jModalClose();
-};');
?>