foreach ($cmds as $item) { $label = $item['title']; $creation_date = $item['creation_date']; $creator = $item['creator']; $target = $item['target']; $target_uuid = $item['uuid']; $cmd_id = $item['cmdid']; $coh_id = $item['cohid']; $bid = $item['bid']; $gid = $item['gid']; $current_state = empty($item['current_state']) ? '' : $item['current_state']; $creation_date = _toDate($creation_date); $status = $item['status']; if ($status) { $icons = state_tmpl_macro($status); } else { $icons = state_tmpl($current_state); } $tab = 'tablogs'; if ($icons['play'] == '' && $icons['stop'] == '' && $icons['pause'] == '') { $tab = 'tabhistory'; } if ($target_uuid && $target_uuid != '') { $param = array('uuid'=>$target_uuid, 'cmd_id'=>$cmd_id, 'bundle_id'=>$bid); if (!isset($gid) || $gid == '') { $param['coh_id'] = $coh_id; } else { $param['gid'] = $gid; } $linkdetail = urlStr("base/computers/msctabs/$tab", $param); $linklogs = urlStr("base/computers/msctabs/$tab", array('uuid'=>$target_uuid, 'gid'=>$gid)); } else { $linkdetail = urlStr("base/computers/groupmsctabs/group$tab", array('uuid'=>$target_uuid, 'cmd_id'=>$cmd_id, 'bundle_id'=>$bid, 'gid'=>$gid)); $linklogs = urlStr("base/computers/groupmsctabs/group$tab", array('uuid'=>$target_uuid, 'gid'=>$gid));
if (isset($statusTable[$coh['current_state']])) { $global_state = $statusTable[$coh['current_state']]; } else { $global_state = $coh['current_state']; } $global_state = sprintf('<img style="vertical-align: middle;" alt="%s" src="modules/msc/graph/images/status/%s"/> ', $coh['current_state'], return_icon($coh['current_state'])) . $global_state; } else { $global_state = sprintf('<img style="vertical-align: middle;" alt="%s" src="modules/msc/graph/images/status/%s"/> %s', 'running', return_icon('running'), _T('Running', 'msc)')); } $a_current[] = $global_state; $p = array('coh_id' => $coh_id, 'cmd_id' => $cmd['id'], 'tab' => $tab, 'uuid' => $uuid, 'hostname' => $coh['host'], 'from' => 'msc|logs|viewLogs', 'gid' => $gid); if (strlen($cmd['bundle_id'])) { $p['bundle_id'] = $cmd['bundle_id']; } $params[] = $p; $icons = state_tmpl($coh['current_state']); $icons['play'] == '' ? $a_start[] = $actionempty : ($a_start[] = $actionplay); $icons['stop'] == '' ? $a_stop[] = $actionempty : ($a_stop[] = $actionstop); $icons['pause'] == '' ? $a_pause[] = $actionempty : ($a_pause[] = $actionpause); if (isset($_GET['coh_id']) && $coh_id == $_GET['coh_id']) { $a_details[] = $actionempty; } else { $a_details[] = $actiondetails; } if (web_def_allow_delete()) { $a_delete[] = $actiondelete; } else { $a_delete[] = $actionempty; } } }