/admin/views/configs/view.html.php

https://bitbucket.org/nathanphan/joomla_zjdonation_custom · PHP · 77 lines · 37 code · 15 blank · 25 comment · 0 complexity · 4605145606bd47ad1febc351a4c1309b MD5 · raw file

  1. <?php
  2. /**
  3. * @version $Id$
  4. * @author Joomseller
  5. * @package Joomla!
  6. * @subpackage ZJ_Donation
  7. * @copyright Copyright (C) 2008 - 2011 by Joomseller Solutions. All rights reserved.
  8. * @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL, SEE LICENSE.php
  9. * This file may not be redistributed in whole or significant part.
  10. */
  11. // no direct access
  12. defined('_JEXEC') or die('Restricted access');
  13. jimport('joomla.application.component.view');
  14. /**
  15. * ZJ_Donation Component - Configs View
  16. * @package ZJ_Donation
  17. * @subpackage View
  18. */
  19. class ZJ_DonationViewConfigs extends JView {
  20. /**
  21. * Display.
  22. */
  23. function display($tpl = null) {
  24. global $mainframe;
  25. // get data from model
  26. $row = $this->get('Data');
  27. jimport('joomla.html.pane');
  28. JHTML::_('behavior.switcher');
  29. // Build the component's submenu
  30. $contents = '';
  31. $tmplpath = dirname(__FILE__).DS.'tmpl';
  32. ob_start();
  33. require_once($tmplpath.DS.'navigation.php');
  34. $contents = ob_get_contents();
  35. ob_end_clean();
  36. // Set document data
  37. $document = &JFactory::getDocument();
  38. $document->setBuffer($contents, 'modules', 'submenu');
  39. // set page title
  40. $document = &JFactory::getDocument();
  41. $document->setTitle(JText::_('ZJ Donation Configuration'));
  42. //
  43. JToolBarHelper::title(JText::_('ZJ Donation Configuration'), 'config.png');
  44. JToolBarHelper::apply();
  45. JToolBarHelper::save();
  46. JToolBarHelper::spacer();
  47. JToolBarHelper::back(JText::_('Back'), 'index.php?option=com_zj_donation');
  48. $tabs = &JPane::getInstance();
  49. $editor = &JFactory::getEditor();
  50. // build the community component list
  51. $community_components = $this->get('CommunityComponents');
  52. $community_components = array_merge(array(array('value' => '0', 'text' => '- ' . JText::_('None') . ' -')), $community_components);
  53. $lists['community_components'] = JHTML::_('select.genericlist', $community_components, 'config[community_integrate]', 'class="inputbox" size="1"', 'value', 'text', $row->get('community_integrate'));
  54. // build the purchase user type list
  55. $lists['donate_user_types'] = JHTML::_('select.genericlist', $this->get('DonateUserTypes'), 'config[donate_permission]', 'class="inputbox" size="1"', 'value', 'text', $row->get('donate_permission'));
  56. $this->assignRef('row', $row);
  57. $this->assignRef('lists', $lists);
  58. $this->assignRef('tabs', $tabs);
  59. $this->assignRef('editor', $editor);
  60. parent::display($tpl);
  61. }
  62. }