Skip to content

Commit

Permalink
Prepare 3.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed Mar 6, 2014
1 parent 3673770 commit e912c5a
Show file tree
Hide file tree
Showing 14 changed files with 263 additions and 192 deletions.
2 changes: 1 addition & 1 deletion administrator/includes/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Installation check, and check on removal of the install directory.
if (!file_exists(JPATH_CONFIGURATION . '/configuration.php')
|| (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) /*|| file_exists(JPATH_INSTALLATION . '/index.php')*/)
|| (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || file_exists(JPATH_INSTALLATION . '/index.php'))
{
if (file_exists(JPATH_INSTALLATION . '/index.php'))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
; Note : All ini files need to be saved as UTF-8

PLG_AUTHENTICATION_GMAIL="Authentication - GMail"
PLG_GMAIL_ERROR_ACCOUNT_DISABLED_OR_NOT_ACTIVATED="Your local account is disabled or not activated"
PLG_GMAIL_ERROR_LOCAL_USERNAME_CONFLICT="A local username conflicts with your GMail user"
PLG_GMAIL_FIELD_APPLYSUFFIX_DESC="Options for applying the suffix: Don't apply the suffix, only apply the suffix if missing (any user supplied suffix will be used) or always apply the suffix replacing any user supplied suffix"
PLG_GMAIL_FIELD_APPLYSUFFIX_LABEL="Apply Username Suffix"
PLG_GMAIL_FIELD_BACKEND_LOGIN_DESC="Allow backend login via GMail account?"
PLG_GMAIL_FIELD_BACKEND_LOGIN_LABEL="Backend login"
PLG_GMAIL_FIELD_SUFFIX_DESC="A suffix to use for the username, typically gmail.com (or googlemail.com) is the suffix but you may wish to use a Google Apps for Your Domain suffix. This doesn't include the @ symbol, if left blank username suffix will be ignored."
PLG_GMAIL_FIELD_SUFFIX_LABEL="Username Suffix"
PLG_GMAIL_FIELD_USER_BLACKLIST_DESC="A list of usernames not permitted to log in via the GMail plugin. The user names should be separated by a comma."
Expand Down
4 changes: 2 additions & 2 deletions administrator/manifests/files/joomla.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<authorUrl>www.joomla.org</authorUrl>
<copyright>(C) 2005 - 2014 Open Source Matters. All rights reserved</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>3.2.3-dev</version>
<creationDate>February 2014</creationDate>
<version>3.2.3</version>
<creationDate>March 2014</creationDate>
<description>FILES_JOOMLA_XML_DESCRIPTION</description>

<scriptfile>administrator/components/com_admin/script.php</scriptfile>
Expand Down
34 changes: 22 additions & 12 deletions components/com_tags/models/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ protected function getListQuery()
$language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all');
}

$listQuery = New JHelperTags;
$query = $listQuery->getTagItemsQuery($tagId, $typesr, $includeChildren, $orderByOption, $orderDir, $matchAll, $language, $stateFilter);
$tagsHelper = new JHelperTags;
$query = $tagsHelper->getTagItemsQuery($tagId, $typesr, $includeChildren, $orderByOption, $orderDir, $matchAll, $language, $stateFilter);

if ($this->state->get('list.filter'))
{
$query->where($this->_db->quoteName('c.core_title') . ' LIKE ' . $this->_db->quote('%' . $this->state->get('list.filter') . '%'));
Expand Down Expand Up @@ -174,23 +175,26 @@ protected function populateState($ordering = 'c.core_title', $direction = 'ASC')
$this->setState('params', $params);

// Load state from the request.
$pk = $app->input->getObject('id');
$pk = (array) $pk;
$pkString = '';
$ids = $app->input->get('id', array(), 'array');

foreach ($pk as $id)
{
$pkString .= (int) $id . ',';
}
$pkString = rtrim($pkString, ',');
JArrayHelper::toInteger($ids);

$pkString = implode(',', $ids);

$this->setState('tag.id', $pkString);

// Get the selected list of types from the request. If none are specified all are used.
$typesr = $app->input->getObject('types');
$typesr = $app->input->get('types', array(), 'array');

if ($typesr)
{
$typesr = (array) $typesr;
// Implode is needed because the array can contain a string with a coma separated list of ids
$typesr = implode(',', $typesr);

// Sanitise
$typesr = explode(',', $typesr);
JArrayHelper::toInteger($typesr);

$this->setState('tag.typesr', $typesr);
}

Expand All @@ -199,6 +203,7 @@ protected function populateState($ordering = 'c.core_title', $direction = 'ASC')

// List state information
$format = $app->input->getWord('format');

if ($format == 'feed')
{
$limit = $app->getCfg('feed_limit');
Expand All @@ -214,6 +219,7 @@ protected function populateState($ordering = 'c.core_title', $direction = 'ASC')
$limit = $this->state->params->get('maximum', 20);
}
}

$this->setState('list.limit', $limit);

$offset = $app->input->get('limitstart', 0, 'uint');
Expand All @@ -222,18 +228,22 @@ protected function populateState($ordering = 'c.core_title', $direction = 'ASC')
$itemid = $pkString . ':' . $app->input->get('Itemid', 0, 'int');
$orderCol = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order', 'filter_order', '', 'string');
$orderCol = !$orderCol ? $this->state->params->get('tag_list_orderby', 'c.core_title') : $orderCol;

if (!in_array($orderCol, $this->filter_fields))
{
$orderCol = 'c.core_title';
}

$this->setState('list.ordering', $orderCol);

$listOrder = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order_direction', 'filter_order_Dir', '', 'string');
$listOrder = !$listOrder ? $this->state->params->get('tag_list_orderby_direction', 'ASC') : $listOrder;

if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', '')))
{
$listOrder = 'ASC';
}

$this->setState('list.direction', $listOrder);

$this->setState('tag.state', 1);
Expand Down
2 changes: 1 addition & 1 deletion includes/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// Installation check, and check on removal of the install directory.
if (!file_exists(JPATH_CONFIGURATION . '/configuration.php')
|| (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) /*|| file_exists(JPATH_INSTALLATION . '/index.php')*/)
|| (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || file_exists(JPATH_INSTALLATION . '/index.php'))
{
if (file_exists(JPATH_INSTALLATION . '/index.php'))
{
Expand Down
132 changes: 63 additions & 69 deletions libraries/cms/helper/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,6 @@ public function deleteTagData(JTable $table, $contentItemId)
*/
public function getItemTags($contentType, $id, $getTagData = true)
{
if (is_array($id))
{
$id = implode($id);
}

// Initialize some variables.
$db = JFactory::getDbo();
$query = $db->getQuery(true)
Expand All @@ -380,7 +375,7 @@ public function getItemTags($contentType, $id, $getTagData = true)
->where(
array(
$db->quoteName('m.type_alias') . ' = ' . $db->quote($contentType),
$db->quoteName('m.content_item_id') . ' = ' . $id,
$db->quoteName('m.content_item_id') . ' = ' . (int) $id,
$db->quoteName('t.published') . ' = 1'
)
);
Expand Down Expand Up @@ -420,45 +415,51 @@ public function getItemTags($contentType, $id, $getTagData = true)
* Method to get a list of tags for a given item.
* Normally used for displaying a list of tags within a layout
*
* @param integer $id The id (primary key) of the item to be tagged.
* @param string $prefix Dot separated string with the option and view to be used for a url.
* @param mixed $ids The id or array of ids (primary key) of the item to be tagged.
* @param string $prefix Dot separated string with the option and view to be used for a url.
*
* @return string Comma separated list of tag Ids.
*
* @since 3.1
*/
public function getTagIds($id, $prefix)
public function getTagIds($ids, $prefix)
{
if (!empty($id))
if (empty($ids))
{
if (is_array($id))
{
$id = implode(',', $id);
}
return;
}

$db = JFactory::getDbo();
/**
* Ids possible formats:
* ---------------------
* $id = 1;
* $id = array(1,2);
* $id = array('1,3,4,19');
* $id = '1,3';
*/
$ids = (array) $ids;
$ids = implode(',', $ids);
$ids = explode(',', $ids);
JArrayHelper::toInteger($ids);

// Load the tags.
$query = $db->getQuery(true)
->select($db->quoteName('t.id'))
->from($db->quoteName('#__tags') . ' AS t ')
->join(
'INNER', $db->quoteName('#__contentitem_tag_map') . ' AS m'
. ' ON ' . $db->quoteName('m.tag_id') . ' = ' . $db->quoteName('t.id')
. ' AND ' . $db->quoteName('m.type_alias') . ' = ' . $db->quote($prefix)
. ' AND ' . $db->quoteName('m.content_item_id') . ' IN ( ' . $id . ')'
);
$db = JFactory::getDbo();

$db->setQuery($query);
// Load the tags.
$query = $db->getQuery(true)
->select($db->quoteName('t.id'))
->from($db->quoteName('#__tags') . ' AS t ')
->join(
'INNER', $db->quoteName('#__contentitem_tag_map') . ' AS m'
. ' ON ' . $db->quoteName('m.tag_id') . ' = ' . $db->quoteName('t.id')
. ' AND ' . $db->quoteName('m.type_alias') . ' = ' . $db->quote($prefix)
. ' AND ' . $db->quoteName('m.content_item_id') . ' IN ( ' . implode(',', $ids) . ')'
);

// Add the tags to the content data.
$tagsList = $db->loadColumn();
$this->tags = implode(',', $tagsList);
}
else
{
$this->tags = null;
}
$db->setQuery($query);

// Add the tags to the content data.
$tagsList = $db->loadColumn();
$this->tags = implode(',', $tagsList);

return $this->tags;
}
Expand Down Expand Up @@ -491,39 +492,30 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals

$ntagsr = substr_count($tagId, ',') + 1;

// Force ids to array and sanitize
$tagIds = (array) $tagId;
$tagIds = implode(',', $tagIds);
$tagIds = explode(',', $tagIds);
JArrayHelper::toInteger($tagIds);

// If we want to include children we have to adjust the list of tags.
// We do not search child tags when the match all option is selected.
if ($includeChildren)
{
if (!is_array($tagId))
{
$tagIdArray = explode(',', $tagId);
}
else
{
$tagIdArray = $tagId;
}

$tagTreeList = '';
$tagTreeArray = array();

foreach ($tagIdArray as $tag)
foreach ($tagIds as $tag)
{
if ($this->getTagTreeArray($tag, $tagTreeArray))
{
$tagTreeList .= implode(',', $this->getTagTreeArray($tag, $tagTreeArray)) . ',';
}
$this->getTagTreeArray($tag, $tagTreeArray);
}

if ($tagTreeList)
{
$tagId = trim($tagTreeList, ',');
}
$tagIds = array_unique(array_merge($tagIds, $tagTreeArray));
}

if (is_array($tagId))
{
$tagId = implode(',', $tagId);
}
// Sanitize filter states
$stateFilters = explode(',', $stateFilter);
JArrayHelper::toInteger($stateFilters);

// M is the mapping table. C is the core_content table. Ct is the content_types table.
$query->select('m.type_alias, m.content_item_id, m.core_content_id, count(m.tag_id) AS match_count, MAX(m.tag_date) as tag_date, MAX(c.core_title) AS core_title')
Expand All @@ -545,8 +537,8 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals

->join('LEFT', '#__users AS ua ON ua.id = c.core_created_user_id')

->where('m.tag_id IN (' . $tagId . ')')
->where('c.core_state IN (' . $stateFilter . ')');
->where('m.tag_id IN (' . implode(',', $tagIds) . ')')
->where('c.core_state IN (' . implode(',', $stateFilters) . ')');

// Optionally filter on language
if (empty($language))
Expand Down Expand Up @@ -585,7 +577,7 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals
if ($ntagsr > 1 && $anyOrAll != 1 && $includeChildren != 1)
{
// The number of results should equal the number of tags requested.
$query->having("COUNT('m.tag_id') = " . $ntagsr);
$query->having("COUNT('m.tag_id') = " . (int) $ntagsr);
}

// Set up the order by using the option chosen
Expand All @@ -595,7 +587,7 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals
}
else
{
$orderBy = 'MAX(' . $orderByOption . ')';
$orderBy = 'MAX(' . $db->quoteName($orderByOption) . ')';
}

$query->order($orderBy . ' ' . $orderDir);
Expand All @@ -619,13 +611,12 @@ public function getTagNames($tagIds)
if (is_array($tagIds) && count($tagIds) > 0)
{
JArrayHelper::toInteger($tagIds);
$tagIds = implode(',', $tagIds);

$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('title'))
->from($db->quoteName('#__tags'))
->where($db->quoteName('id') . ' IN (' . $tagIds . ')');
->where($db->quoteName('id') . ' IN (' . implode(',', $tagIds) . ')');
$query->order($db->quoteName('title'));

$db->setQuery($query);
Expand All @@ -652,7 +643,7 @@ public function getTagTreeArray($id, &$tagTreeArray = array())

if ($table->isLeaf($id))
{
$tagTreeArray[] .= $id;
$tagTreeArray[] = $id;

return $tagTreeArray;
}
Expand Down Expand Up @@ -709,18 +700,19 @@ public static function getTypes($arrayType = 'objectList', $selectTypes = null,

if (!empty($selectTypes))
{
if (is_array($selectTypes))
{
$selectTypes = implode(',', $selectTypes);
}
$selectTypes = (array) $selectTypes;

if ($useAlias)
{
$query->where($db->quoteName('type_alias') . ' IN (' . $db->quote($selectTypes) . ')');
$selectTypes = array_map(array($db, 'quote'), $selectTypes);

$query->where($db->quoteName('type_alias') . ' IN (' . implode(',', $selectTypes) . ')');
}
else
{
$query->where($db->quoteName('type_id') . ' IN (' . $selectTypes . ')');
JArrayHelper::toInteger($selectTypes);

$query->where($db->quoteName('type_id') . ' IN (' . implode(',', $selectTypes) . ')');
}
}

Expand Down Expand Up @@ -1024,6 +1016,8 @@ public function unTagItem($contentId, $table, $tags = array())

if (is_array($tags) && count($tags) > 0)
{
JArrayHelper::toInteger($tags);

$query->where($db->quoteName('tag_id') . ' IN ' . implode(',', $tags));
}

Expand Down
8 changes: 4 additions & 4 deletions libraries/cms/version/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ final class JVersion
public $RELEASE = '3.2';

/** @var string Maintenance version. */
public $DEV_LEVEL = '3-dev';
public $DEV_LEVEL = '3';

/** @var string Development STATUS. */
public $DEV_STATUS = 'Development';
public $DEV_STATUS = 'Stable';

/** @var string Build number. */
public $BUILD = '';
Expand All @@ -37,10 +37,10 @@ final class JVersion
public $CODENAME = 'Ember';

/** @var string Release date. */
public $RELDATE = '6-February-2014';
public $RELDATE = '6-March-2014';

/** @var string Release time. */
public $RELTIME = '16:00';
public $RELTIME = '14:30';

/** @var string Release timezone. */
public $RELTZ = 'GMT';
Expand Down
Loading

0 comments on commit e912c5a

Please sign in to comment.