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

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

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 79 lines | 37 code | 12 blank | 30 comment | 1 complexity | 7a251f8800976f03acd81a6c85144550 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 links view
  14. *
  15. * @package NewLifeInIT
  16. * @subpackage com_redirect
  17. * @version 1.0
  18. */
  19. class RedirectViewLinks extends JView
  20. {
  21. /**
  22. * Display the view
  23. */
  24. public function display($tpl = null)
  25. {
  26. // Get data from the model.
  27. $this->state = $this->get('State');
  28. $this->items = $this->get('Items');
  29. $this->pagination = $this->get('Pagination');
  30. // Check for errors.
  31. if (count($errors = $this->get('Errors'))) {
  32. JError::raiseError(500, implode("\n", $errors));
  33. return false;
  34. }
  35. // Build the state filter options.
  36. $poptions[] = JHTML::_('select.option','*', 'Any');
  37. $poptions[] = JHTML::_('select.option', '0', 'Pending');
  38. $poptions[] = JHTML::_('select.option', '1', 'Active');
  39. $poptions[] = JHTML::_('select.option', '2', 'Archived');
  40. // Assign data to the view.
  41. $this->filter_state = $poptions;
  42. $this->buildDefaultToolBar();
  43. // Render the layout.
  44. parent::display($tpl);
  45. }
  46. /**
  47. * Build the default toolbar.
  48. *
  49. * @return void
  50. * @since 1.0
  51. */
  52. protected function buildDefaultToolBar()
  53. {
  54. $bar = JToolBar::getInstance('toolbar');
  55. JToolBarHelper::title('Redirect: Links', 'logo');
  56. JToolBarHelper::custom('link.activate', 'default.png', 'default_f2.png', 'Activate', true);
  57. JToolBarHelper::custom('link.archive', 'archive.png', 'archive_f2.png', 'Archive', true);
  58. JToolBarHelper::custom('link.publish', 'publish.png', 'publish_f2.png', 'Publish', true);
  59. JToolBarHelper::custom('link.unpublish', 'unpublish.png', 'unpublish_f2.png', 'Unpublish', true);
  60. JToolBarHelper::custom('link.edit', 'edit.png', 'edit_f2.png', 'Edit', true);
  61. JToolBarHelper::custom('link.add', 'new.png', 'new_f2.png', 'New', false);
  62. JToolBarHelper::deleteList('Are you sure you want to remove these links?', 'link.delete', 'delete');
  63. // We can't use the toolbar helper here because there is no generic popup button.
  64. JToolBar::getInstance('toolbar')
  65. ->appendButton('Popup', 'help', 'COM_REDIRECT_TOOLBAR_ABOUT', 'index.php?option=com_redirect&view=about&tmpl=component');
  66. }
  67. }