Skip to content

Commit

Permalink
Added version to CafeVariome class and dashboard footer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi Mehtarizadeh committed Mar 18, 2022
1 parent 0b12bba commit 0fe2ac1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/Controllers/CVUI_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ protected function wrapData(UIData $uidata): array
$data['statusMessageType'] = $this->getStatusMessageTypeAlertEquivalent();
$data["uriSegments"] = $this->getURISegments();
$data['headerImage'] = $headerImage;
$data['version'] = $uidata->cv_version;

//Include additional data attributes specific to each view
foreach ($uidata->data as $dataKey => $dataValue) {
Expand Down
10 changes: 10 additions & 0 deletions app/Libraries/CafeVariome/CafeVariome.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
class CafeVariome
{

/**
* @var string $version of Cafe Variome Software
*/
private static string $version = '2.2.0';

/**
* Boot - Initialises constants from .env file
* @return void
Expand All @@ -30,4 +35,9 @@ public static function Boot()
define('ELASTICSERACH_AGGREGATE_SIZE', getenv('ELASTICSERACH_AGGREGATE_SIZE'));
define('ELASTICSERACH_EXTRACT_AGGREGATE_SIZE', getenv('ELASTICSERACH_EXTRACT_AGGREGATE_SIZE'));
}

public static function getVersion(): string
{
return self::$version;
}
}
18 changes: 11 additions & 7 deletions app/Models/UIData.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php namespace App\Models;

use App\Libraries\CafeVariome\CafeVariome;

/**
* Class UIData
* Class UIData
* @author: Mehdi Mehtarizadeh
* Created: 18/06/2019
* This class contains data passed to views from controllers.
*
*
* This class contains data passed to views from controllers.
*
*
*/

class UIData
Expand All @@ -16,12 +18,12 @@ class UIData
//Page info
public $data = Array();
public $pageName = FALSE;

//Page contents
public $javascript = array();
public $css = array();
public $fonts = array();

//Page Meta
public $title = FALSE;
public $description = FALSE;
Expand All @@ -30,9 +32,11 @@ class UIData

public $stickyFooter = true;

public $cv_version = "";

public function __construct()
{

$this->cv_version = CafeVariome::getVersion();
}

}
Expand Down
2 changes: 1 addition & 1 deletion app/Views/layout/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
<footer class="sticky-footer">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Powered by <a target="_blank" href="https://www.cafevariome.org/">Café Variome </a> <br> Copyright &copy; <?= date("Y") . ', University of Leicester' ?> </span>
<span>Powered by <a target="_blank" href="https://www.cafevariome.org/">Café Variome </a> (v <?= $version ?>)<br> Copyright &copy; <?= date("Y") . ', University of Leicester' ?> </span>
</div>
</div>
</footer>
Expand Down

0 comments on commit 0fe2ac1

Please sign in to comment.