CreateWebSettings.inc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. /**
  3. * Create default websettings XML
  4. *
  5. * @category Phpdocx
  6. * @package elements
  7. * @copyright Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
  8. * (http://www.2mdc.com)
  9. * @license LGPL
  10. * @version 1.0
  11. * @link http://www.phpdocx.com
  12. * @since File available since Release 1.0
  13. */
  14. include_once dirname(__FILE__) . '/CreateElement.inc';
  15. /**
  16. * Create default websettings XML
  17. *
  18. * @category Phpdocx
  19. * @package elements
  20. * @copyright Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
  21. * (http://www.2mdc.com)
  22. * @license http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
  23. * @version 1.0
  24. * @link http://www.phpdocx.com
  25. * @since Class available since Release 1.0
  26. */
  27. class CreateWebSettings extends CreateElement
  28. {
  29. /**
  30. *
  31. * @access protected
  32. */
  33. protected $_xml;
  34. /**
  35. *
  36. * @access private
  37. * @static
  38. */
  39. private static $_instance = NULL;
  40. /**
  41. * Construct
  42. *
  43. * @access public
  44. */
  45. public function __construct()
  46. {
  47. }
  48. /**
  49. * Destruct
  50. *
  51. * @access public
  52. */
  53. public function __destruct()
  54. {
  55. }
  56. /**
  57. * Magic method, returns current XML
  58. *
  59. * @access public
  60. * @return string Return current XML
  61. */
  62. public function __toString()
  63. {
  64. return $this->_xml;
  65. }
  66. /**
  67. * Singleton, return instance of class
  68. *
  69. * @access public
  70. * @return CreateWebSettings
  71. */
  72. public static function getInstance()
  73. {
  74. if (self::$_instance == NULL) {
  75. self::$_instance = new CreateWebSettings();
  76. }
  77. return self::$_instance;
  78. }
  79. /**
  80. * Main tags of websettings XML
  81. *
  82. * @access public
  83. */
  84. public function generateWebSettings()
  85. {
  86. $this->_xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'
  87. . '<' . CreateElement::NAMESPACEWORD . ':webSettings '
  88. . 'xmlns:r="http://schemas.openxmlformats.org/officeDocument/'
  89. . '2006/relationships" xmlns:w="http://schemas.openxmlformats.'
  90. . 'org/wordprocessingml/2006/main"><'
  91. . CreateElement::NAMESPACEWORD . ':optimizeForBrowser /></'
  92. . CreateElement::NAMESPACEWORD . ':webSettings>';
  93. }
  94. }