- md5
- 37a0fd56e6f532bea2f4b6ed8e1769b9
- sha1
- 60668cd2cc082919ddb22aed723a57bac58f94a3
- sha256
- 27102db1420b11d7881e02e520216be20bc4ff80283a4c7145822d2e4d824e83
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
<?php
/**
* @package Joomla.Administrator
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Contact component helper.
*
* @since 1.6
*/
class ContactHelper extends JHelperContent
{
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
*
* @since 1.6
*/
public static function addSubmenu($vName)
{
JHtmlSidebar::addEntry(
JText::_('COM_CONTACT_SUBMENU_CONTACTS'),
'index.php?option=com_contact&view=contacts',
$vName == 'contacts'
);
JHtmlSidebar::addEntry(
JText::_('COM_CONTACT_SUBMENU_CATEGORIES'),
'index.php?option=com_categories&extension=com_contact',
$vName == 'categories'
);
}
/**
* Adds Count Items for Category Manager.
*
* @param JDatabaseQuery &$query The query object of com_categories
*
* @return JDatabaseQuery
*
* @since 3.4
*/
public static function countItems(&$query)
{
// Join articles to categories and count published items
$query->select('COUNT(DISTINCT cp.id) AS count_published');
$query->join('LEFT', '#__contact_details AS cp ON cp.catid = a.id AND cp.published = 1');
// Count unpublished items
$query->select('COUNT(DISTINCT cu.id) AS count_unpublished');
$query->join('LEFT', '#__contact_details AS cu ON cu.catid = a.id AND cu.published = 0');
// Count archived items
$query->select('COUNT(DISTINCT ca.id) AS count_archived');
$query->join('LEFT', '#__contact_details AS ca ON ca.catid = a.id AND ca.published = 2');
// Count trashed items
$query->select('COUNT(DISTINCT ct.id) AS count_trashed');
$query->join('LEFT', '#__contact_details AS ct ON ct.catid = a.id AND ct.published = -2');
return $query;
}
}
The same content is in 6 releases, Joomla 3.5.0-beta2 to 3.5.0-rc2. See them all, or every version of this file.