managemodule.html.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace zin;
  3. jsVar('moduleProcesses', $moduleProcesses);
  4. jsVar('cannotDelete', $lang->process->cannotDelete);
  5. jsVar('cannotDeleteWithName', $lang->process->cannotDeleteWithName);
  6. $items[] = array('name' => 'id', 'label' => $lang->process->id, 'width' => '40px', 'required' => false, 'hidden' => true);
  7. $items[] = array('name' => 'name', 'label' => $lang->process->moduleName, 'width' => '240px', 'required' => true);
  8. $data = array();
  9. foreach($modules as $id => $name)
  10. {
  11. if(!$id) continue;
  12. $data[] = array('id' => $id, 'name' => trim($name, '/'), 'count' => isset($moduleProcesses[$id]) ? $moduleProcesses[$id]->count : 0);
  13. }
  14. $maxRows = !empty($data) ? count($data) + 1 : 5;
  15. $batchFormOptions = array();
  16. $batchFormOptions['actions'] = array('sort', 'add', 'delete');
  17. formBatchPanel
  18. (
  19. set::batchFormOptions($batchFormOptions),
  20. set::title($lang->process->manageModule),
  21. set::actionsText(''),
  22. set::data($data),
  23. set::sortable(true),
  24. set::items($items),
  25. set::onRenderRow(jsRaw('window.handleRenderRow')),
  26. set::maxRows($maxRows)
  27. );