Skip to content

Commit

Permalink
Introduce Cacti Beta Constant
Browse files Browse the repository at this point in the history
This will make it clear to users that they are running a beta version of
Cacti
  • Loading branch information
cigamit committed Sep 2, 2018
1 parent ab36370 commit 637c436
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion about.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<tr class='tableHeader'>
<td class='tableSubHeaderColumn' colspan="2">
<font class='textSubHeaderDark'><?php print __('Version %s', CACTI_VERSION); ?></font>
<font class='textSubHeaderDark'><?php print get_cacti_version_text(); ?></font>
</td>
</tr>
<tr>
Expand Down
1 change: 1 addition & 0 deletions include/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

/* define cacti version */
define('CACTI_VERSION', $cacti_version);
define('CACTI_VERSION_BETA', true);

/* Default database settings*/
$database_type = 'mysql';
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function render_external_links($style = 'FRONT') {
</ul>
</td>
<td class="textAreaNotes top right">
<strong><?php print __('Version %s', CACTI_VERSION);?></strong>
<strong><?php print get_cacti_version_text();?></strong>
</td>
</tr>
<?php if ($config['poller_id'] > 1) {?>
Expand Down
7 changes: 7 additions & 0 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5257,6 +5257,13 @@ function get_cacti_version() {
return $version;
}

/**
* get_cacti_version_text Return the cacti version text including beta moniker
*/
function get_cacti_version_text() {
return trim(__('Cacti Version %s %s', CACTI_VERSION, (CACTI_VERSION_BETA == true ? __('- Beta'):'')));
}

/**
* get_cacti_cli_version() {
*/
Expand Down
4 changes: 4 additions & 0 deletions lib/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function html_start_box($title, $width, $div, $cell_padding, $align, $add_text,
$add_label = __('Add');
}

if (CACTI_VERSION_BETA) {
$title .= ' [ ' . get_cacti_version_text() . ' ]';
}

$table_prefix = basename(get_current_page(), '.php');;
if (!isempty_request_var('report')) {
$table_prefix .= '_' . clean_up_name(get_nfilter_request_var('report'));
Expand Down

0 comments on commit 637c436

Please sign in to comment.