BxWikiModule.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Wiki Wiki
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxWikiModule extends BxDolModule
  12. {
  13. function __construct(&$aModule)
  14. {
  15. parent::__construct($aModule);
  16. }
  17. public function serviceGetSafeServices()
  18. {
  19. return array (
  20. 'Contents' => '',
  21. 'MissingTranslations' => '',
  22. 'OutdatedTranslations' => '',
  23. );
  24. }
  25. /**
  26. * @page service Service Calls
  27. * @section bx_wiki Wiki
  28. * @subsection bx_wiki-macros Macros
  29. * @subsubsection bx_wiki-contents contents
  30. *
  31. * @code bx_srv('bx_wiki', 'contents'); @endcode
  32. * @code {{~bx_wiki:contents~}} @endcode
  33. *
  34. * Wiki contents - list of pages
  35. *
  36. * @see BxWikiModule::serviceContents
  37. */
  38. /**
  39. * @ref bx_wiki-contents "contents"
  40. */
  41. public function serviceContents ()
  42. {
  43. if (!($oWiki = BxDolWiki::getObjectInstance($this->getName())))
  44. return '';
  45. return $oWiki->getContents();
  46. }
  47. /**
  48. * @page service Service Calls
  49. * @section bx_wiki Wiki
  50. * @subsection bx_wiki-macros Macros
  51. * @subsubsection bx_wiki-missing_translations missing_translations
  52. *
  53. * @code bx_srv('bx_wiki', 'missing_translations'); @endcode
  54. * @code {{~bx_wiki:missing_translations["ru"]~}} @endcode
  55. *
  56. * Get list of blocks with missing translations
  57. * @param $sLang language to get missing translations for
  58. *
  59. * @see BxWikiModule::serviceMissingTranslations
  60. */
  61. /**
  62. * @ref bx_wiki-missing_translations "missing_translations"
  63. */
  64. public function serviceMissingTranslations ($sLang)
  65. {
  66. if (!($oWiki = BxDolWiki::getObjectInstance($this->getName())))
  67. return '';
  68. return $oWiki->getMissingTranslations($sLang);
  69. }
  70. /**
  71. * @page service Service Calls
  72. * @section bx_wiki Wiki
  73. * @subsection bx_wiki-macros Macros
  74. * @subsubsection bx_wiki-outdated_translations outdated_translations
  75. *
  76. * @code bx_srv('bx_wiki', 'outdated_translations'); @endcode
  77. * @code {{~bx_wiki:outdated_translations["ru"]~}} @endcode
  78. *
  79. * Get list of blocks with outdated translations
  80. * @param $sLang language to get outdated translations for
  81. *
  82. * @see BxWikiModule::serviceOutdatedTranslations
  83. */
  84. /**
  85. * @ref bx_wiki-outdated_translations "outdated_translations"
  86. */
  87. public function serviceOutdatedTranslations ($sLang)
  88. {
  89. if (!($oWiki = BxDolWiki::getObjectInstance($this->getName())))
  90. return '';
  91. return $oWiki->getOutdatedTranslations($sLang);
  92. }
  93. }
  94. /** @} */