Skip to content
Snippets Groups Projects
Commit 908d5b8c authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

get version from 1st json file

parent 451c4105
No related branches found
No related tags found
1 merge request!62V2.0
......@@ -59,8 +59,7 @@ if (isset($_SERVER) && is_array($_SERVER) && array_key_exists("REQUEST_URI", $_S
foreach (array_keys($aParams) as $sKey) {
$aParams[$sKey] = is_string($aParams[$sKey])
? str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $aParams[$sKey])
: $aParams[$sKey]
;
: $aParams[$sKey];
}
}
......@@ -68,7 +67,8 @@ if (isset($_SERVER) && is_array($_SERVER) && array_key_exists("REQUEST_URI", $_S
* get home link as button
* @return string
*/
function aHome($sClass = "btn btn-default") {
function aHome($sClass = "btn btn-default")
{
global $oHtml;
// if (!array_key_exists("prj", $aParams)) return false;
return $oHtml->getLinkButton(array(
......@@ -83,7 +83,8 @@ function aHome($sClass = "btn btn-default") {
* get project Home link as button
* @return string
*/
function aPrjHome($sClass = "btn btn-default") {
function aPrjHome($sClass = "btn btn-default")
{
global $aParams, $oHtml;
if (!array_key_exists("prj", $aParams)) {
return false;
......@@ -107,7 +108,8 @@ function aPrjHome($sClass = "btn btn-default") {
* get go back link as button
* @return string
*/
function aGoback($sClass = "btn btn-default") {
function aGoback($sClass = "btn btn-default")
{
global $oHtml;
return $oHtml->getLinkButton(array(
'href' => '#',
......@@ -122,7 +124,8 @@ function aGoback($sClass = "btn btn-default") {
* get go top link as button
* @return string
*/
function aGotop($sClass = "scroll-link btn btn-default") {
function aGotop($sClass = "scroll-link btn btn-default")
{
global $oHtml;
return $oHtml->getLinkButton(array(
'href' => '#top',
......@@ -137,7 +140,8 @@ function aGotop($sClass = "scroll-link btn btn-default") {
* get array top left navigation
* @return array
*/
function getTopNavLeft($aEmbed=[]) {
function getTopNavLeft($aEmbed = [])
{
global $aParams, $oHtml;
$aReturn = [];
require_once("./classes/project.class.php");
......@@ -188,8 +192,7 @@ function getTopNavLeft($aEmbed=[]) {
$aReturn[] = [
'href' => '#', 'label' => t("menu-projects"), 'icon' => 'fa-solid fa-box-open',
'children' => $aPrjItems
]
;
];
}
if ($sCurrentProject) {
$oPrj = new project($aParams["prj"]);
......@@ -216,7 +219,6 @@ function getTopNavLeft($aEmbed=[]) {
'children' => $aPrjChildren
];
}
}
// echo '<pre>'.print_r($aReturn, 1); die(__FUNCTION__);
return $aReturn;
......@@ -226,7 +228,8 @@ function getTopNavLeft($aEmbed=[]) {
* get array top left navigation
* @return array
*/
function getTopNavRight() {
function getTopNavRight()
{
global $aParams, $oHtml;
$aReturn = [];
require_once("./classes/project.class.php");
......@@ -242,7 +245,8 @@ function getTopNavRight() {
if ($oUser->getUsername()) {
$aReturn = [
['href'=>'#', 'label'=>$oUser->getUsername(), 'icon'=>'fa-solid fa-user',
[
'href' => '#', 'label' => $oUser->getUsername(), 'icon' => 'fa-solid fa-user',
'class' => ($sCurrentAction == 'login' ? 'active' : ''),
'children' => [
['href' => $sBaseUrl . 'all/login/', 'label' => t("menu-userprofile"), 'icon' => 'fa-regular fa-id-card', 'class' => ($sCurrentAction == 'login' ? 'active' : '')],
......@@ -252,7 +256,8 @@ function getTopNavRight() {
} else {
$aReturn[] = ['href' => $sBaseUrl . 'all/login/', 'label' => t("login"), 'icon' => 'fa-solid fa-right-to-bracket', 'class' => ($sCurrentAction == 'login' ? 'active' : '')];
}
$aReturn[]=['href'=>'#', 'label'=>t('menu-help'), 'icon'=>'fa-solid fa-life-ring', 'class'=>'',
$aReturn[] = [
'href' => '#', 'label' => t('menu-help'), 'icon' => 'fa-solid fa-life-ring', 'class' => '',
'children' => [
['href' => $sWikiBaseUrl . '/it/entwicklung/continuous_deployment', 'target' => '_help', 'label' => 'WIKI: Übersicht Continous Deployment', 'icon' => ''],
['href' => $sWikiBaseUrl . '/it/entwicklung/continuous_deployment#konventionen', 'target' => '_help', 'label' => 'WIKI: Konventionen für Entwickler', 'icon' => ''],
......@@ -260,8 +265,7 @@ function getTopNavRight() {
['href' => $sWikiBaseUrl . '/it/infrastruktur/dienste/imldeployment', 'target' => '_help', 'label' => 'WIKI (Admin): Verzeichnisse und Dateien', 'icon' => ''],
['href' => $sBaseUrl . 'all/doc', 'label' => t('menu-help-classes'), 'icon' => ''],
]
]
;
];
// echo '<pre>'.print_r($aReturn, 1); die(__FUNCTION__);
return $aReturn;
......@@ -273,7 +277,8 @@ function getTopNavRight() {
* @param string $sLinkClass classname for links; default: "" (adds class="btn btn-default")
* @return string
*/
function getBreadcrumb($sLinkClass="") {
function getBreadcrumb($sLinkClass = "")
{
global $aParams, $oHtml;
$sReturn = '';
$sNav = '';
......@@ -312,6 +317,22 @@ function getBreadcrumb($sLinkClass="") {
return $sReturn;
}
/**
* get version info
* @return string
*/
function getVersioninfo()
{
$sMyRev = "";
$aFiles = glob(dirname(dirname(__DIR__)) . "/*.json");
if (isset($aFiles[0])) {
$aJson = json_decode(file_get_contents($aFiles[0]), true);
$sMyRev = (isset($aJson["branch"]) ? $aJson["branch"] . ' - ' : '')
. (isset($aJson["date"]) ? $aJson["date"] : '');
}
return ($sMyRev ? $sMyRev . ' @ ' : '') . php_uname("n");
}
/**
* translate function
* @global type $aConfig
......@@ -319,7 +340,8 @@ function getBreadcrumb($sLinkClass="") {
* @param string $s text
* @return string
*/
function t($s) {
function t($s)
{
global $aConfig;
static $aLang = array();
......@@ -346,7 +368,8 @@ function t($s) {
* @global type $aParams
* @return string
*/
function enterDeployinfos() {
function enterDeployinfos()
{
global $aParams;
$sIdUser = "inputUser";
$sIdComment = "inputComment";
......
<?php
define("APP_VERSION", '2.0-alpha');
define("APP_VERSION", '2.0');
session_start();
......
......@@ -145,7 +145,7 @@ tr:hover{background:#f0f4f8; background_: linear-gradient(#f4f4f4,#fff,#f4f4f4);
div.progressinprogress{color: #17a2b8;}
div.progresshasqueue{color: #d61;}
tr.progressinprogress{border-left:0.3em solid #17a2b8; }
tr.progresshasqueue{border-left:0.3em solid #f81;}
tr.progresshasqueue{border-left:0.3em solid #d61;}
td.prj:nth-child(1) {max-width: 30em;}
td.prj:nth-child(1) a{display: block; padding: 0.3em 0.5em; border-radius: 0.3em; background-color: #f0f4f8;}
......
......@@ -66,5 +66,5 @@ return [
// '{{INJECT_JS}}' => $cr->renderJSLang(),
'{{INJECT_JS}}' => '',
'{{PAGE_FOOTER_LEFT}}'=>' &copy; 2013-' . date("Y") . ' <a href="https://www.iml.unibe.ch/" target="_blank">Institut f&uuml;r Medizinische Lehre; Universit&auml;t Bern</a>',
'{{PAGE_FOOTER_RIGHT}}'=>'Source: <a href="https://git-repo.iml.unibe.ch/iml-open-source/imldeployment/" target="_blank">git-repo.iml.unibe.ch</a>',
'{{PAGE_FOOTER_RIGHT}}'=>getVersioninfo() . ' | Source: <a href="https://git-repo.iml.unibe.ch/iml-open-source/imldeployment/" target="_blank">git-repo.iml.unibe.ch</a>',
];
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment