PageRenderTime 56ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/aamenu/code/trunk/administrator/components/com_aamenu/views/aamenu/view.html.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 67 lines | 31 code | 9 blank | 27 comment | 1 complexity | ef005c1c9dd5f25f1a835afcb1041962 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: view.html.php 269 2010-09-01 00:23:48Z eddieajau $
  4. * @copyright Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
  5. * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
  6. * @link http://www.theartofjoomla.com
  7. */
  8. // no direct access
  9. defined('_JEXEC') or die;
  10. jimport('joomla.application.component.view');
  11. /**
  12. * @package Artof.AAMenu
  13. * @subpackage com_aamenu
  14. */
  15. class AAMenuViewAAMenu extends JView
  16. {
  17. public $state;
  18. public $items;
  19. public $tags;
  20. public $pagination;
  21. /**
  22. * Display the main view.
  23. *
  24. * @param string $tpl The template file to display.
  25. *
  26. * @return void
  27. * @since 1.0.0
  28. */
  29. public function display($tpl = null)
  30. {
  31. $this->state = $this->get('State');
  32. $this->items = $this->get('Items');
  33. $this->tags = $this->get('Tags');
  34. $this->pagination = $this->get('Pagination');
  35. // Check for errors.
  36. if (count($errors = $this->get('Errors'))) {
  37. JError::raiseError(500, implode("\n", $errors));
  38. return false;
  39. }
  40. $this->setToolbar();
  41. parent::display($tpl);
  42. }
  43. /**
  44. * Add the toolbar controls.
  45. *
  46. * @return void
  47. * @since 1.0.3
  48. */
  49. function setToolbar()
  50. {
  51. JToolBarHelper::title(JText::_('COM_AAMENU_TITLE'), 'logo');
  52. JToolBarHelper::save('tags.save', 'COM_AAMENU_Toolbar_Save_Changes');
  53. JToolBarHelper::preferences('com_aamenu', 360, 600, 'COM_AAMENU_TOOLBAR_OPTIONS');
  54. // We can't use the toolbar helper here because there is no generic popup button.
  55. JToolBar::getInstance('toolbar')
  56. ->appendButton('Popup', 'help', 'COM_AAMENU_TOOLBAR_ABOUT', 'index.php?option=com_aamenu&view=about&tmpl=component');
  57. }
  58. }