docmycreatedblock.html.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * The docmycreated block view file of block module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(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 Guangming Sun <sunguangming@easycorp.ltd>
  7. * @package block
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $canView = common::hasPriv('doc', 'view');
  12. $docItems = array();
  13. foreach($docList as $doc)
  14. {
  15. $editTip = $lang->doc->todayUpdated;
  16. $interval = $doc->editInterval;
  17. if($interval->year)
  18. {
  19. $editTip = sprintf($lang->doc->yearsUpdated, $interval->year);
  20. }
  21. elseif($interval->month)
  22. {
  23. $editTip = sprintf($lang->doc->monthsUpdated, $interval->month);
  24. }
  25. elseif($interval->day)
  26. {
  27. $editTip = sprintf($lang->doc->daysUpdated, $interval->day);
  28. }
  29. $docType = $doc->type == 'text' ? 'wiki-file' : $doc->type;
  30. $docItems[] = cell
  31. (
  32. set::width('32%'),
  33. setStyle('width', '32%'),
  34. setClass('border rounded p-2'),
  35. a
  36. (
  37. setClass('text-left w-full'),
  38. set('href', $canView ? createLink('doc', 'view', "docID={$doc->id}") : null),
  39. span(setClass('text-gray my-2 pl-2 pull-right'), $editTip),
  40. div
  41. (
  42. setClass('font-bold my-2 mr-2 clip doc-title'),
  43. img
  44. (
  45. setClass('inline pr-1'),
  46. set('src', "static/svg/{$docType}.svg")
  47. ),
  48. $doc->title
  49. ),
  50. p
  51. (
  52. setClass('edit-date text-gray'),
  53. $lang->doc->editedDate . (common::checkNotCN() ? ': ' : ':') . $doc->editedDate
  54. )
  55. )
  56. );
  57. }
  58. blockPanel(empty($docList) ? $lang->doc->noDoc : div(setClass('flex flex-wrap content-between gap-3'), $docItems));
  59. render();