ajaxgetdropmenu.html.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * The ajaxgetdropmenu view file of demandpool 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 Yuting Wang <wangyuting@easycorp.ltd>
  7. * @package demandpool
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $data = array();
  12. foreach($demandpools as $currentPoolID => $pool)
  13. {
  14. $item = array();
  15. $item['id'] = $currentPoolID;
  16. $item['name'] = $pool->name;
  17. $item['text'] = $pool->name;
  18. $item['title'] = $pool->name;
  19. $item['active'] = $poolID == $currentPoolID;
  20. $item['url'] = sprintf($link, $currentPoolID);
  21. $item['type'] = 'item';
  22. $data[] = $item;
  23. }
  24. $json = array();
  25. $json['data'] = $data;
  26. $json['searchHint'] = $lang->searchAB;
  27. /**
  28. * 渲染 JSON 字符串并发送到客户端。
  29. * Render json data to string and send to client.
  30. */
  31. renderJson($json);