v1.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * The contactUs widget class file of zin module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2024 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  6. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Gang Liu <liugang@easycorp.ltd>
  8. * @package zin
  9. * @link http://www.zentao.net
  10. */
  11. namespace zin;
  12. class contactUs extends wg
  13. {
  14. /**
  15. * @var mixed[]
  16. */
  17. protected static $defineProps = [
  18. 'text?: string',
  19. ];
  20. protected function buildContent()
  21. {
  22. global $config, $lang;
  23. $content = [];
  24. foreach($config->contactUs as $key => $value)
  25. {
  26. $content[] = $lang->contactUs->$key . $lang->colon . ($key == 'email' ? "<a class='not-open-url' href='mailto:$value'>$value</a>" : $value);
  27. }
  28. return html(implode($lang->comma, $content));
  29. }
  30. protected function build()
  31. {
  32. global $lang;
  33. return div
  34. (
  35. setClass('font-bold text-center mt-2'),
  36. $this->prop('text', $lang->contactUs->common),
  37. $this->buildContent()
  38. );
  39. }
  40. }