GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( b9bf49...b5e3c2 )
by
unknown
10:06
created

component/admin/views/languages/view.html.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
 * Languages View class for the Localise component
14
 *
15
 * @package     Extensions.Components
16
 * @subpackage  Localise
17
 *
18
 * @since       1.0
19
 */
20
class LocaliseViewLanguages extends JViewLegacy
21
{
22
	protected $items;
23
24
	protected $pagination;
25
26
	protected $state;
27
28
	protected $form;
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 View Code Duplication
	public function display($tpl = null)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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
45
		LocaliseHelper::addSubmenu('languages');
46
47
		// Check for errors.
48
		if (count($errors = $this->get('Errors')))
49
		{
50
			JError::raiseError(500, implode("\n", $errors));
51
52
			return false;
53
		}
54
55
		// Set the toolbar
56
		$this->addToolbar();
57
		$this->sidebar = JHtmlSidebar::render();
58
59
		// Display the view
60
		parent::display($tpl);
61
	}
62
63
	/**
64
	 * Add the page title and toolbar.
65
	 *
66
	 * @return  void
67
	 *
68
	 * @since   1.6
69
	 */
70
	protected function addToolbar()
71
	{
72
		$canDo = JHelperContent::getActions('com_localise', 'component');
73
74
		JToolbarHelper::title(JText::sprintf('COM_LOCALISE_HEADER_MANAGER', JText::_('COM_LOCALISE_HEADER_LANGUAGES')), 'comments-2 langmanager');
75
76
		if ($canDo->get('localise.create'))
77
		{
78
			JToolbarHelper::addNew('language.add');
79
			JToolbarHelper::custom('languages.purge', 'purge', 'purge', 'COM_LOCALISE_PURGE', false, false);
80
			JToolbarHelper::divider();
81
		}
82
83
		if ($canDo->get('core.admin'))
84
		{
85
			JToolbarHelper::preferences('com_localise');
86
			JToolbarHelper::divider();
87
		}
88
89
		JToolBarHelper::help('screen.languages', true);
90
91
		JHtmlSidebar::setAction('index.php?option=com_localise&view=languages');
92
	}
93
94
	/**
95
	 * Returns an array of fields the table can be sorted by
96
	 *
97
	 * @return  array  Array containing the field name to sort by as the key and display text as value
98
	 *
99
	 * @since 3.0
100
	 */
101
	protected function getSortFields()
102
	{
103
		return array(
104
			'name'   => JText::_('COM_LOCALISE_HEADING_LANGUAGES_NAME'),
105
			'tag'    => JText::_('COM_LOCALISE_HEADING_LANGUAGES_TAG'),
106
			'client' => JText::_('COM_LOCALISE_HEADING_LANGUAGES_CLIENT'),
107
		);
108
	}
109
}
110