TabPane.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category ZendX
  16. * @package ZendX_JQuery
  17. * @subpackage View
  18. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. require_once "UiWidgetPane.php";
  23. /**
  24. * jQuery Tabs Pane View Helper, goes with Tab Container
  25. *
  26. * @uses Zend_Json, ZendX_JQuery_View_Helper_TabContainer
  27. * @package ZendX_JQuery
  28. * @subpackage View
  29. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. */
  32. class ZendX_JQuery_View_Helper_TabPane extends ZendX_JQuery_View_Helper_UiWidgetPane
  33. {
  34. /**
  35. * Add a tab pane to the tab container with the given $id.
  36. *
  37. * @param string $id
  38. * @param string $content
  39. * @param array $options
  40. * @return string always empty
  41. */
  42. public function tabPane($id=null, $content='', array $options=array())
  43. {
  44. if(0 === func_num_args()) {
  45. return $this;
  46. }
  47. $name = '';
  48. if(isset($options['title'])) {
  49. $name = $options['title'];
  50. unset($options['title']);
  51. }
  52. $this->_addPane($id, $name, $content, $options);
  53. return '';
  54. }
  55. /**
  56. * Register new tab pane with tabContainer view helper.
  57. *
  58. * @see ZendX_JQuery_View_Helper_TabContainer::addPane
  59. * @param string $id
  60. * @param string $name
  61. * @param string $content
  62. * @param array $options
  63. * @return void
  64. */
  65. protected function _addPane($id, $name, $content, array $options=array())
  66. {
  67. $this->view->tabContainer()->addPane($id, $name, $content, $options);
  68. }
  69. }