common.html.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * The columnitem file of pivot design module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2024 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Chenxuan Song <songchenxuan@easycorp.ltd>
  7. * @package pivot
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $fnGenerateHelpIcon = function($text, $useToggle = true, $placement = 'right')
  12. {
  13. if(empty($text)) return span(setClass('text-warning'), icon('help'));
  14. return btn
  15. (
  16. setClass('inline ghost'),
  17. set::size('sm'),
  18. setData(array('title' => $text, 'placement' => $placement, 'className' => 'text-gray border border-light', 'type' => 'white', 'hideOthers' => true)),
  19. $useToggle ? set('data-toggle', 'tooltip') : null,
  20. icon('help')
  21. );
  22. };
  23. $fnGenerateExportBtn = function()
  24. {
  25. return toolbar
  26. (
  27. hasPriv('pivot', 'export') ? item(set(array
  28. (
  29. 'text' => $this->lang->export,
  30. 'icon' => 'export',
  31. 'class' => 'ghost',
  32. 'data-target' => '#export',
  33. 'data-toggle' => 'modal',
  34. 'data-size' => 'sm'
  35. ))) : null
  36. );
  37. };