- md5
- 87b71895149a2415a4fe41309f53455b
- sha1
- b97c9c3ae0fbe6ef6c3c4661b75d7dba338278ae
- sha256
- a862315ce21a0eb8cb72259489a12b81ba9e9f8eca42da8c1dc465fea46b7c5b
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
<?php
/**
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* View class for a list of modules.
*
* @package Joomla.Administrator
* @subpackage com_modules
* @since 1.6
*/
class ModulesViewModules extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*/
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;
}
// Check if there are no matching items
if(!count($this->items)){
JFactory::getApplication()->enqueueMessage(
JText::_('COM_MODULES_MSG_MANAGE_NO_MODULES')
, 'warning'
);
}
$this->addToolbar();
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
JToolBarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'module.png');
if ($canDo->get('core.create')) {
//JToolBarHelper::addNew('module.add');
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400);
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('module.edit');
}
if ($canDo->get('core.create')) {
JToolBarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
} elseif ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('modules.trash');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_modules');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
}
}
The same content is in 2 releases, Joomla 2.5.7 to 2.5.8. See them all, or every version of this file.