['regexp' => '/^([a-z_A-Z]+)$/']]); // ==================================================== top_header(); // present a tabbed interface $tabs = [ 'highlights' => __('Highlights'), 'full' => __('Full'), ]; // set the default tab load_current_session_value('tab', 'sess_cl_tabs', 'summary'); $current_tab = gnrv('tab'); $page = 'changelog.php?tab=' . $current_tab; $refresh = [ 'seconds' => 999999, 'page' => $page, 'logout' => 'false' ]; set_page_refresh($refresh); $i = 0; // draw the tabs print "
'; $tab = grv('tab'); if (empty($tabs[$tab])) { $tab_keys = array_keys($tabs); $tab = reset($tab_keys); } $header_label = __esc('Change Log [%s]', $tabs[$tab]); // Display tech information $changelog = file(CACTI_PATH_BASE . '/CHANGELOG'); $full = $current_tab == 'full'; array_shift($changelog); array_shift($changelog); $ver = ''; $vers = []; $details = []; $first = ''; foreach ($changelog as $line) { $line = trim($line); if (isset($line[0]) && ($line[0] == '*' || $line[0] == '-')) { $detail = false; if (preg_match('/-(issue|feature|security): (.*)/i', $line, $parts)) { $detail = ['desc' => $parts[2]]; } elseif (preg_match('/-(issue|feature|security)#(\d+)\: (.*)/i', $line, $parts)) { $detail = ['desc' => $parts[3], 'issue' => $parts[2]]; } $type = 'unknown'; if (isset($parts[1])) { $type = cacti_strtolower($parts[1]); if ($type == 'security') { $type = ' security'; } } if (!empty($detail)) { if (empty($details[$type])) { $details[$type] = []; } $details[$type][] = $detail; } } elseif (!empty($line)) { if (!empty($ver)) { $vers[$ver] = $details; $first = true; $details = []; } if (count($vers) > 4) { break; } $ver = $line; } } krsort($vers); foreach ($vers as $ver => $changelog) { if ($ver != '') { html_start_box(__('Version %s', $ver), '100%', false, 3, 'center', ''); ksort($changelog); foreach ($changelog as $type => $details) { $output = false; foreach ($details as $detail) { $highlight = false; switch ($type) { case 'issue': $icon = ''; break; case 'feature': $icon = ''; $highlight = true; break; case ' security': $icon = ''; $highlight = true; break; default: $icon = ''; break; } if ($current_tab == 'full' || $highlight) { if (!$output) { html_section_header(htmle($type), 4); $output = true; } form_alternate_row(); print '