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 ( ff89c5...24245f )
by
unknown
15:11 queued 06:12
created

component/admin/views/translations/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
 * 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
	protected $minCmsVersion = '3.8';
31
32
	/**
33
	 * Display the view
34
	 *
35
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
36
	 *
37
	 * @return  void
38
	 */
39
	public function display($tpl = null)
40
	{
41
		// Get the data
42
		$this->items      = $this->get('Items');
43
		$this->pagination = $this->get('Pagination');
44
		$this->state      = $this->get('State');
45
		$this->form       = $this->get('Form');
46
		$this->packages   = $this->get('Items', 'Packages');
47
		$this->filterForm    = $this->get('FilterForm');
48
		$this->activeFilters = $this->get('ActiveFilters');
49
50 View Code Duplication
		if (version_compare(JVERSION, $this->minCmsVersion, 'lt'))
0 ignored issues
show
This code seems to be duplicated across 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...
51
		{
52
			JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_LOCALISE_ERROR_INSTALL_JVERSION', $this->minCmsVersion), 'warning');
53
54
			return false;
55
		}
56
57
		LocaliseHelper::addSubmenu('translations');
58
59
		// Check for errors.
60
		if (count($errors = $this->get('Errors')))
61
		{
62
			JError::raiseError(500, implode("<br />", $errors));
63
64
			return false;
65
		}
66
67
		// Set the toolbar
68
		$this->addToolbar();
69
		$this->sidebar = JHtmlSidebar::render();
70
71
		// Display the view
72
		parent::display($tpl);
73
	}
74
75
	/**
76
	 * Add the page title and toolbar.
77
	 *
78
	 * @return  void
79
	 *
80
	 * @since   1.6
81
	 */
82
	protected function addToolbar()
83
	{
84
		$canDo = JHelperContent::getActions('com_localise', 'component');
85
86
		JToolbarHelper::title(JText::sprintf('COM_LOCALISE_HEADER_MANAGER', JText::_('COM_LOCALISE_HEADER_TRANSLATIONS')), 'comments-2 langmanager');
87
88
		if ($canDo->get('core.admin'))
89
		{
90
			JToolbarHelper::preferences('com_localise');
91
			JToolbarHelper::divider();
92
		}
93
94
		JToolBarHelper::help('screen.translations', true);
95
	}
96
}
97