PageRenderTime 61ms CodeModel.GetById 44ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/administrator/components/com_installer/views/database/view.html.php

https://bitbucket.org/eternaware/joomus
PHP | 74 lines | 42 code | 6 blank | 26 comment | 4 complexity | c999a4caef88489b93b7903f411c0e81 MD5 | raw file
Possible License(s): LGPL-2.1
 1<?php
 2/**
 3 * @package     Joomla.Administrator
 4 * @subpackage  com_installer
 5 *
 6 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 7 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 8 */
 9
10defined('_JEXEC') or die;
11
12include_once __DIR__ . '/../default/view.php';
13
14/**
15 * Extension Manager Manage View
16 *
17 * @package     Joomla.Administrator
18 * @subpackage  com_installer
19 * @since       1.6
20 */
21class InstallerViewDatabase extends InstallerViewDefault
22{
23	/**
24	 * @since	1.6
25	 */
26	public function display($tpl = null)
27	{
28		// Get data from the model
29		$this->state = $this->get('State');
30		$this->changeSet = $this->get('Items');
31		$this->errors = $this->changeSet->check();
32		$this->results = $this->changeSet->getStatus();
33		$this->schemaVersion = $this->get('SchemaVersion');
34		$this->updateVersion = $this->get('UpdateVersion');
35		$this->filterParams  = $this->get('DefaultTextFilters');
36		$this->schemaVersion = ($this->schemaVersion) ?  $this->schemaVersion : JText::_('JNONE');
37		$this->updateVersion = ($this->updateVersion) ?  $this->updateVersion : JText::_('JNONE');
38		$this->pagination = $this->get('Pagination');
39		$this->errorCount = count($this->errors);
40
41		$errors = count($this->errors);
42		if (!(strncmp($this->schemaVersion, JVERSION, 5) === 0))
43		{
44			$this->errorCount++;
45		}
46		if (!$this->filterParams)
47		{
48			$this->errorCount++;
49		}
50		if (($this->updateVersion != JVERSION))
51		{
52			$this->errorCount++;
53		}
54
55		parent::display($tpl);
56	}
57
58	/**
59	 * Add the page title and toolbar.
60	 *
61	 * @since	1.6
62	 */
63	protected function addToolbar()
64	{
65		$canDo	= InstallerHelper::getActions();
66		/*
67		 * Set toolbar items for the page
68		 */
69		JToolbarHelper::custom('database.fix', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_DATABASE_FIX', false, false);
70		JToolbarHelper::divider();
71		parent::addToolbar();
72		JToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_DATABASE');
73	}
74}