2
0

BorderContainer.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 Zend
  16. * @package Zend_Dojo
  17. * @subpackage View
  18. * @copyright Copyright (c) 2005-2015 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. /** Zend_Dojo_View_Helper_DijitContainer */
  23. require_once 'Zend/Dojo/View/Helper/DijitContainer.php';
  24. /**
  25. * Dojo BorderContainer dijit
  26. *
  27. * @uses Zend_Dojo_View_Helper_DijitContainer
  28. * @package Zend_Dojo
  29. * @subpackage View
  30. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. */
  33. class Zend_Dojo_View_Helper_BorderContainer extends Zend_Dojo_View_Helper_DijitContainer
  34. {
  35. /**
  36. * Dijit being used
  37. * @var string
  38. */
  39. protected $_dijit = 'dijit.layout.BorderContainer';
  40. /**
  41. * Dojo module to use
  42. * @var string
  43. */
  44. protected $_module = 'dijit.layout.BorderContainer';
  45. /**
  46. * Ensure style is only registered once
  47. * @var bool
  48. */
  49. protected $_styleIsRegistered = false;
  50. /**
  51. * dijit.layout.BorderContainer
  52. *
  53. * @param string $id
  54. * @param string $content
  55. * @param array $params Parameters to use for dijit creation
  56. * @param array $attribs HTML attributes
  57. * @return string
  58. */
  59. public function borderContainer($id = null, $content = '', array $params = array(), array $attribs = array())
  60. {
  61. if (0 === func_num_args()) {
  62. return $this;
  63. }
  64. // this will ensure that the border container is viewable:
  65. if (!$this->_styleIsRegistered) {
  66. $this->view->headStyle()->appendStyle('html, body { height: 100%; width: 100%; margin: 0; padding: 0; }');
  67. $this->_styleIsRegistered = true;
  68. }
  69. // and now we create it:
  70. return $this->_createLayoutContainer($id, $content, $params, $attribs);
  71. }
  72. }