browseflow.html.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace zin;
  3. jsVar('activateTips', $lang->workflow->tips->activate);
  4. jsVar('activateList', $lang->workflow->activateList);
  5. $items[] = array
  6. (
  7. 'text' => $lang->workflow->all,
  8. 'active' => !$currentApp,
  9. 'url' => inlink('browseFlow', "mode=$mode&status=&app=&param={$param}&orderBy=$orderBy"),
  10. 'props' => array('data-id' => 'all', 'title' => $lang->workflow->all),
  11. 'textClass' => 'text-ellipsis max-w-32'
  12. );
  13. $flowApps = $this->workflow->getFlowApps();
  14. foreach($flowApps as $appCode)
  15. {
  16. $appName = zget($apps, $appCode, '');
  17. if($appCode == 'project') $appName = $lang->project->common;
  18. if(!$appName) continue;
  19. $isActive = $appCode == $currentApp;
  20. $items[] = array
  21. (
  22. 'text' => $appName,
  23. 'active' => $isActive,
  24. 'url' => inlink('browseFlow', "mode=browse&status=&app=$appCode&param={$param}&orderBy=$orderBy"),
  25. 'props' => array('data-id' => $appCode, 'title' => $appName),
  26. 'textClass' => 'text-ellipsis max-w-32'
  27. );
  28. }
  29. featureBar
  30. (
  31. set::items($items),
  32. li(searchToggle(set::open($mode == 'bysearch')))
  33. );
  34. $viewType = $this->cookie->flowViewType ? $this->cookie->flowViewType : 'card';
  35. toolbar
  36. (
  37. item(set(array
  38. (
  39. 'type' => 'btnGroup',
  40. 'items' => array(
  41. array
  42. (
  43. 'icon' => 'cards-view',
  44. 'class' => 'btn-icon switchButton' . ($viewType == 'card' ? ' text-primary' : ''),
  45. 'data-type' => 'card'
  46. ),
  47. array
  48. (
  49. 'icon' => 'bars',
  50. 'class' => 'switchButton btn-icon' . ($viewType == 'list' ? ' text-primary' : ''),
  51. 'data-type' => 'list'
  52. )
  53. )
  54. ))),
  55. hasPriv('workflow', 'create') ? btn
  56. (
  57. set(array(
  58. 'className' => 'primary',
  59. 'icon' => 'plus',
  60. 'text' => $lang->workflow->create,
  61. 'url' => createLink('workflow', 'create', "type=flow&parent=&app=$currentApp"),
  62. 'data-toggle' => 'modal',
  63. 'data-size' => 'sm'
  64. ))
  65. ) : null
  66. );
  67. if($viewType == 'card') include 'card.html.php';
  68. if($viewType == 'list') include 'list.html.php';