From 20d9da22e317fa4c39a75916b2410cdb45c16210 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Tue, 4 Apr 2017 17:30:57 +0200
Subject: [PATCH] go back button (as function)

---
 public_html/deployment/inc_functions.php    | 7 +++++++
 public_html/deployment/pages/act_accept.php | 2 +-
 public_html/deployment/pages/act_build.php  | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/public_html/deployment/inc_functions.php b/public_html/deployment/inc_functions.php
index 045a408c..c4c33d31 100644
--- a/public_html/deployment/inc_functions.php
+++ b/public_html/deployment/inc_functions.php
@@ -143,6 +143,13 @@ function aPrjHome($sClass = "btn btn-default") {
     return '<a href="/deployment/' . $aParams["prj"] . '/" class="' . $sClass . '"><i class=" glyphicon glyphicon-book"></i> ' . t("menu-project-home") . ' <strong>' . $oPrj->getLabel() . '</strong></a>';
 }
 
+/**
+ * get go back link as button
+ * @return string
+ */
+function aGoback($sClass = "btn btn-default") {
+    return '<a href="#" onclick="history.back();" class="' . $sClass . '" title="' . t("back") . '"><i class="glyphicon glyphicon-chevron-left"></i> ' . t("back") . '</a> ';
+}
 /**
  * get go top link as button
  * @return string
diff --git a/public_html/deployment/pages/act_accept.php b/public_html/deployment/pages/act_accept.php
index 9ee95d35..358f3891 100644
--- a/public_html/deployment/pages/act_accept.php
+++ b/public_html/deployment/pages/act_accept.php
@@ -88,7 +88,7 @@ if (array_key_exists("confirm", $aParams)) {
                  <form action="?" method="post" enctype="multipart/form-data">
                     <input type="hidden" name="confirm" value="1">
                     <fieldset>
-                        <a class="btn btn-default btn-large" onclick="history.back();">' . t("back") . '</a>
+                        '.aGoback().'
                         <button type="submit" class="btn btn-primary btn-large" >' . sprintf(t("page-accept-buttonlabel"), $sPhase, $sNext) . '</button>
                     </fieldset>
                  </form>
diff --git a/public_html/deployment/pages/act_build.php b/public_html/deployment/pages/act_build.php
index 9bc43603..2292efe0 100644
--- a/public_html/deployment/pages/act_build.php
+++ b/public_html/deployment/pages/act_build.php
@@ -97,7 +97,7 @@ if (!array_key_exists("confirm", $aParams)) {
                      <hr>
                     -->
                     <fieldset>
-                        <a class="btn btn-default btn-large" onclick="history.back();">' . t("back") . '</a>
+                        '.aGoback().'
                         <button type="submit" class="btn btn-primary btn-large" >' . sprintf(t("page-build-buttonlabel"), $sNext) . '</button>
                     </fieldset>
                  </form>
-- 
GitLab