- md5
- c9e121438507cf1c905eb3e6704bdb6f
- sha1
- 5816e5196aae5230abb2e80b858915d3f685c61e
- sha256
- fa62c6f9348625820eb6fab060fc61d97b5c98bf57c82754bb20b4e967bb9953
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
<?php
/**
* @version $Id: view.html.php 21705 2011-06-28 21:19:50Z dextercowley $
* @package Joomla.Administrator
* @subpackage com_contact
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
/**
* View class for a list of contacts.
*
* @package Joomla.Administrator
* @subpackage com_contact
* @since 1.6
*/
class ContactViewContacts extends JView
{
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*
* @return void
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
// Preprocess the list of items to find ordering divisions.
// TODO: Complete the ordering stuff with nested sets
foreach ($this->items as &$item) {
$item->order_up = true;
$item->order_dn = true;
}
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT.'/helpers/contact.php';
$canDo = ContactHelper::getActions($this->state->get('filter.category_id'));
$user = JFactory::getUser();
JToolBarHelper::title(JText::_('COM_CONTACT_MANAGER_CONTACTS'), 'contact.png');
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'))) {
JToolBarHelper::editList('contact.edit');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::publish('contacts.publish', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::unpublish('contacts.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::archiveList('contacts.archive');
JToolBarHelper::checkin('contacts.checkin');
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'contacts.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
}
else if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('contacts.trash');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_contact');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_COMPONENTS_CONTACTS_CONTACTS');
}
}
The same content is in 3 releases, Joomla 1.7.0 to 1.7.2. See them all, or every version of this file.