array('regexp' => '/^([a-z_A-Z]+)$/'))); /* ==================================================== */ top_header(); /* present a tabbed interface */ $tabs = array( 'highlights' => __('Highlights'), 'full' => __('Full'), ); /* set the default tab */ load_current_session_value('tab', 'sess_cl_tabs', 'summary'); $current_tab = get_nfilter_request_var('tab'); $page = 'changelog.php?tab=' . $current_tab; $refresh = array( 'seconds' => 999999, 'page' => $page, 'logout' => 'false' ); set_page_refresh($refresh); $i = 0; /* draw the tabs */ print "
'; $tab = get_request_var('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 = array(); $details = array(); $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 = array('desc' => $parts[2]); } elseif (preg_match('/-(issue|feature|security)#(\d+)\: (.*)/i', $line, $parts)) { $detail = array('desc' => $parts[3], 'issue' => $parts[2]); } $type = 'unknown'; if (isset($parts[1])) { $type = strtolower($parts[1]); if ($type == 'security') { $type = ' security'; } } if (!empty($detail)) { if (empty($details[$type])) { $details[$type] = array(); } $details[$type][] = $detail; } } elseif (!empty($line)) { if (!empty($ver)) { $vers[$ver] = $details; $first =true; $details = array(); } if (count($vers) > 4) { break; } $ver = $line; } } krsort($vers); foreach ($vers as $ver => $changelog) { if (!empty($ver)) { html_start_box(__('Version %s', $ver), '100%', '', '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(html_escape($type), 4); $output = true; } form_alternate_row(); print '