1
0

BxWikiModule.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. * @param $sAllExceptSpecified optional comma separated list of URIs of pages to filter out
  36. * @param $sOnlySpecified optional comma separated list of URIs of pages to show only
  37. *
  38. * @see BxWikiModule::serviceContents
  39. */
  40. /**
  41. * @ref bx_wiki-contents "contents"
  42. */
  43. public function serviceContents ($sAllExceptSpecified = '', $sOnlySpecified = '')
  44. {
  45. if (!($oWiki = BxDolWiki::getObjectInstance($this->getName())))
  46. return '';
  47. return $oWiki->getContents($sAllExceptSpecified, $sOnlySpecified);
  48. }
  49. /**
  50. * @page service Service Calls
  51. * @section bx_wiki Wiki
  52. * @subsection bx_wiki-macros Macros
  53. * @subsubsection bx_wiki-missing_translations missing_translations
  54. *
  55. * @code bx_srv('bx_wiki', 'missing_translations'); @endcode
  56. * @code {{~bx_wiki:missing_translations["ru"]~}} @endcode
  57. *
  58. * Get list of blocks with missing translations
  59. * @param $sLang language to get missing translations for
  60. *
  61. * @see BxWikiModule::serviceMissingTranslations
  62. */
  63. /**
  64. * @ref bx_wiki-missing_translations "missing_translations"
  65. */
  66. public function serviceMissingTranslations ($sLang)
  67. {
  68. if (!($oWiki = BxDolWiki::getObjectInstance($this->getName())))
  69. return '';
  70. return $oWiki->getMissingTranslations($sLang);
  71. }
  72. /**
  73. * @page service Service Calls
  74. * @section bx_wiki Wiki
  75. * @subsection bx_wiki-macros Macros
  76. * @subsubsection bx_wiki-outdated_translations outdated_translations
  77. *
  78. * @code bx_srv('bx_wiki', 'outdated_translations'); @endcode
  79. * @code {{~bx_wiki:outdated_translations["ru"]~}} @endcode
  80. *
  81. * Get list of blocks with outdated translations
  82. * @param $sLang language to get outdated translations for
  83. *
  84. * @see BxWikiModule::serviceOutdatedTranslations
  85. */
  86. /**
  87. * @ref bx_wiki-outdated_translations "outdated_translations"
  88. */
  89. public function serviceOutdatedTranslations ($sLang)
  90. {
  91. if (!($oWiki = BxDolWiki::getObjectInstance($this->getName())))
  92. return '';
  93. return $oWiki->getOutdatedTranslations($sLang);
  94. }
  95. }
  96. /** @} */