PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/redirect/code/trunk/administrator/components/com_redirect/views/link/view.html.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 80 lines | 36 code | 12 blank | 32 comment | 5 complexity | 448517f285dcfabf00592b49532c7f15 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: view.html.php 390 2010-11-05 11:35:33Z eddieajau $
  4. * @package NewLifeInIT
  5. * @subpackage com_redirect
  6. * @copyright Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
  7. * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
  8. * @link http://www.theartofjoomla.com
  9. */
  10. defined('_JEXEC') or die('Invalid Request.');
  11. jimport('joomla.application.component.view');
  12. /**
  13. * The HTML Redirect link view
  14. *
  15. * @package NewLifeInIT
  16. * @subpackage com_redirect
  17. * @version 1.0
  18. */
  19. class RedirectViewLink extends JView
  20. {
  21. /**
  22. * Display the view
  23. *
  24. * @access public
  25. */
  26. function display($tpl = null)
  27. {
  28. $this->state = $this->get('State');
  29. $this->item = $this->get('Item');
  30. $this->form = $this->get('Form');
  31. // Check for errors.
  32. if (count($errors = $this->get('Errors'))) {
  33. JError::raiseError(500, implode("\n", $errors));
  34. return false;
  35. }
  36. // Bind the item data to the form object.
  37. if ($this->item) {
  38. $this->form->bind($this->item);
  39. }
  40. $this->buildDefaultToolBar();
  41. parent::display($tpl);
  42. }
  43. /**
  44. * Build the default toolbar.
  45. *
  46. * @return void
  47. * @since 1.0
  48. */
  49. protected function buildDefaultToolBar()
  50. {
  51. JRequest::setVar('hidemainmenu', true);
  52. if (is_object($this->item)) {
  53. $isNew = ($this->item->id == 0);
  54. }
  55. else {
  56. $isNew = true;
  57. }
  58. JToolBarHelper::title('Redirect: '.$isNew ? 'Add Link' : 'Edit Link', 'logo');
  59. JToolBarHelper::custom('link.save2new', 'new.png', 'new_f2.png', 'Save and New', false);
  60. JToolBarHelper::save('link.save');
  61. JToolBarHelper::apply('link.apply');
  62. JToolBarHelper::cancel('link.cancel');
  63. // We can't use the toolbar helper here because there is no generic popup button.
  64. //$bar = &JToolBar::getInstance('toolbar');
  65. //$bar->appendButton('Popup', 'config', 'JX_CONFIGURATION', 'index.php?option=com_redirect&view=config&tmpl=component', 570, 500);
  66. //JToolBarHelper::help('index', true);
  67. }
  68. }