/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

  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. defined('_JEXEC') or die;
  10. include_once __DIR__ . '/../default/view.php';
  11. /**
  12. * Extension Manager Manage View
  13. *
  14. * @package Joomla.Administrator
  15. * @subpackage com_installer
  16. * @since 1.6
  17. */
  18. class InstallerViewDatabase extends InstallerViewDefault
  19. {
  20. /**
  21. * @since 1.6
  22. */
  23. public function display($tpl = null)
  24. {
  25. // Get data from the model
  26. $this->state = $this->get('State');
  27. $this->changeSet = $this->get('Items');
  28. $this->errors = $this->changeSet->check();
  29. $this->results = $this->changeSet->getStatus();
  30. $this->schemaVersion = $this->get('SchemaVersion');
  31. $this->updateVersion = $this->get('UpdateVersion');
  32. $this->filterParams = $this->get('DefaultTextFilters');
  33. $this->schemaVersion = ($this->schemaVersion) ? $this->schemaVersion : JText::_('JNONE');
  34. $this->updateVersion = ($this->updateVersion) ? $this->updateVersion : JText::_('JNONE');
  35. $this->pagination = $this->get('Pagination');
  36. $this->errorCount = count($this->errors);
  37. $errors = count($this->errors);
  38. if (!(strncmp($this->schemaVersion, JVERSION, 5) === 0))
  39. {
  40. $this->errorCount++;
  41. }
  42. if (!$this->filterParams)
  43. {
  44. $this->errorCount++;
  45. }
  46. if (($this->updateVersion != JVERSION))
  47. {
  48. $this->errorCount++;
  49. }
  50. parent::display($tpl);
  51. }
  52. /**
  53. * Add the page title and toolbar.
  54. *
  55. * @since 1.6
  56. */
  57. protected function addToolbar()
  58. {
  59. $canDo = InstallerHelper::getActions();
  60. /*
  61. * Set toolbar items for the page
  62. */
  63. JToolbarHelper::custom('database.fix', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_DATABASE_FIX', false, false);
  64. JToolbarHelper::divider();
  65. parent::addToolbar();
  66. JToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_DATABASE');
  67. }
  68. }