|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @package Com_Localise |
|
4
|
|
|
* @subpackage views |
|
5
|
|
|
* |
|
6
|
|
|
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. |
|
7
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
defined('_JEXEC') or die; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Translations View class for the Localise component |
|
14
|
|
|
* |
|
15
|
|
|
* @package Extensions.Components |
|
16
|
|
|
* @subpackage Localise |
|
17
|
|
|
* |
|
18
|
|
|
* @since 1.0 |
|
19
|
|
|
*/ |
|
20
|
|
|
class LocaliseViewTranslations extends JViewLegacy |
|
21
|
|
|
{ |
|
22
|
|
|
protected $items; |
|
23
|
|
|
|
|
24
|
|
|
protected $pagination; |
|
25
|
|
|
|
|
26
|
|
|
protected $form; |
|
27
|
|
|
|
|
28
|
|
|
protected $state; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Display the view |
|
32
|
|
|
* |
|
33
|
|
|
* @param string $tpl The name of the template file to parse; automatically searches through the template paths. |
|
34
|
|
|
* |
|
35
|
|
|
* @return void |
|
36
|
|
|
*/ |
|
37
|
|
|
public function display($tpl = null) |
|
38
|
|
|
{ |
|
39
|
|
|
// Get the data |
|
40
|
|
|
$this->items = $this->get('Items'); |
|
41
|
|
|
$this->pagination = $this->get('Pagination'); |
|
42
|
|
|
$this->state = $this->get('State'); |
|
43
|
|
|
$this->form = $this->get('Form'); |
|
44
|
|
|
$this->packages = $this->get('Items', 'Packages'); |
|
45
|
|
|
$this->filterForm = $this->get('FilterForm'); |
|
46
|
|
|
$this->activeFilters = $this->get('ActiveFilters'); |
|
47
|
|
|
|
|
48
|
|
|
LocaliseHelper::addSubmenu('translations'); |
|
49
|
|
|
|
|
50
|
|
|
// Check for errors. |
|
51
|
|
|
if (count($errors = $this->get('Errors'))) |
|
52
|
|
|
{ |
|
53
|
|
|
JError::raiseError(500, implode("<br />", $errors)); |
|
54
|
|
|
|
|
55
|
|
|
return false; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
// Set the toolbar |
|
59
|
|
|
$this->addToolbar(); |
|
60
|
|
|
$this->sidebar = JHtmlSidebar::render(); |
|
61
|
|
|
|
|
62
|
|
|
// Display the view |
|
63
|
|
|
parent::display($tpl); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* Add the page title and toolbar. |
|
68
|
|
|
* |
|
69
|
|
|
* @return void |
|
70
|
|
|
* |
|
71
|
|
|
* @since 1.6 |
|
72
|
|
|
*/ |
|
73
|
|
|
protected function addToolbar() |
|
74
|
|
|
{ |
|
75
|
|
|
$canDo = JHelperContent::getActions('com_localise', 'component'); |
|
76
|
|
|
|
|
77
|
|
|
JToolbarHelper::title(JText::sprintf('COM_LOCALISE_HEADER_MANAGER', JText::_('COM_LOCALISE_HEADER_TRANSLATIONS')), 'comments-2 langmanager'); |
|
78
|
|
|
|
|
79
|
|
|
if ($canDo->get('core.admin')) |
|
80
|
|
|
{ |
|
81
|
|
|
JToolbarHelper::preferences('com_localise'); |
|
82
|
|
|
JToolbarHelper::divider(); |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
JToolBarHelper::help('screen.translations', true); |
|
86
|
|
|
} |
|
87
|
|
|
} |
|
88
|
|
|
|