diff --git a/src/delagent/ui/admin-folder-delete.php b/src/delagent/ui/admin-folder-delete.php index 943def8f..f4b0fc56 100644 --- a/src/delagent/ui/admin-folder-delete.php +++ b/src/delagent/ui/admin-folder-delete.php @@ -1,136 +1,136 @@ Name = "admin_folder_delete"; $this->Title = TITLE_admin_folder_delete; $this->MenuList = "Organize::Folders::Delete Folder"; $this->Dependency = array(); $this->DBaccess = PLUGIN_DB_WRITE; parent::__construct(); $this->dbManager = $GLOBALS['container']->get('db.manager'); } /** * \brief Delete * Creates a job to detele the folder * * \param $folderpk - the folder_pk to remove * \return NULL on success, string on failure. */ function Delete($folderpk, $userId) { /* Can't remove top folder */ if ($folderpk == FolderGetTop()) { $text = _("Can Not Delete Root Folder"); return ($text); } /* Get the folder's name */ $FolderName = FolderGetName($folderpk); /* Prepare the job: job "Delete" */ $groupId = Auth::getGroupId(); $jobpk = JobAddJob($userId, $groupId, "Delete Folder: $FolderName"); if (empty($jobpk) || ($jobpk < 0)) { $text = _("Failed to create job record"); return ($text); } /* Add job: job "Delete" has jobqueue item "delagent" */ $jqargs = "DELETE FOLDER $folderpk"; $jobqueuepk = JobQueueAdd($jobpk, "delagent", $jqargs, NULL, NULL); if (empty($jobqueuepk)) { $text = _("Failed to place delete in job queue"); return ($text); } /* Tell the scheduler to check the queue. */ $success = fo_communicate_with_scheduler("database", $output, $error_msg); if (!$success) return $error_msg . "\n" . $output; return (NULL); } // Delete() /** * \brief Generate the text for this plugin. */ public function Output() { /* If this is a POST, then process the request. */ $folder = GetParm('folder', PARM_INTEGER); if (!empty($folder)) { $userId = Auth::getUserId(); $sql = "SELECT folder_name FROM folder join users on (users.user_pk = folder.user_fk or users.user_perm = 10) where folder_pk = $1 and users.user_pk = $2;"; $Folder = $this->dbManager->getSingleRow($sql,array($folder,$userId),__METHOD__."GetRowWithFolderName"); if(!empty($Folder['folder_name'])){ $rc = $this->Delete($folder, $userId); if (empty($rc)) { /* Need to refresh the screen */ $text = _("Deletion of folder "); $text1 = _(" added to job queue"); $this->vars['message'] = $text . $Folder['folder_name'] . $text1; }else{ $text = _("Deletion of "); $text1 = _(" failed: "); $this->vars['message'] = $text . $Folder['folder_name'] . $text1 . $rc; } }else{ $text = _("Cannot delete this folder :: Permission denied"); $this->vars['message'] = $text; } } $V= "
\n"; return $V; } } $NewPlugin = new admin_folder_delete; diff --git a/src/delagent/ui/admin-upload-delete.php b/src/delagent/ui/admin-upload-delete.php index a4fdcd5c..806df573 100644 --- a/src/delagent/ui/admin-upload-delete.php +++ b/src/delagent/ui/admin-upload-delete.php @@ -1,187 +1,187 @@ Name = "admin_upload_delete"; $this->Title = TITLE_admin_upload_delete; $this->MenuList = "Organize::Uploads::Delete Uploaded File"; $this->DBaccess = PLUGIN_DB_WRITE; parent::__construct(); } /** * \brief Given a folder_pk, try to add a job after checking permissions. * \param $uploadpk - the upload(upload_id) you want to delete * * \return string with the message. */ function TryToDelete($uploadpk) { if (! GetUploadPerm($uploadpk) >= Auth::PERM_WRITE) { $text=_("You dont have permissions to delete the upload"); return DisplayMessage($text); } $rc = $this->Delete($uploadpk); if (! empty($rc)) { $text=_("Deletion Scheduling failed: "); return DisplayMessage($text.$rc); } /* Need to refresh the screen */ $URL = Traceback_uri() . "?mod=showjobs&upload=$uploadpk "; $LinkText = _("View Jobs"); $text=_("Deletion added to job queue."); $msg = "$text $LinkText"; return displayMessage($msg); } /** * \brief Given a folder_pk, add a job. * \param $uploadpk - the upload(upload_id) you want to delete * \param $Depends - Depends is not used for now * * \return NULL on success, string on failure. */ function Delete($uploadpk, $Depends = NULL) { /* Prepare the job: job "Delete" */ $user_pk = Auth::getUserId(); $group_pk = Auth::getGroupId(); $jobpk = JobAddJob($user_pk, $group_pk, "Delete", $uploadpk); if (empty($jobpk) || ($jobpk < 0)) { $text = _("Failed to create job record"); return ($text); } /* Add job: job "Delete" has jobqueue item "delagent" */ $jqargs = "DELETE UPLOAD $uploadpk"; $jobqueuepk = JobQueueAdd($jobpk, "delagent", $jqargs, NULL, NULL); if (empty($jobqueuepk)) { $text = _("Failed to place delete in job queue"); return ($text); } /* Tell the scheduler to check the queue. */ $success = fo_communicate_with_scheduler("database", $output, $error_msg); if (!$success) { $error_msg = _("Is the scheduler running? Your jobs have been added to job queue."); $URL = Traceback_uri() . "?mod=showjobs&upload=$uploadpk "; $LinkText = _("View Jobs"); $msg = "$error_msg $LinkText"; return $msg; } return (NULL); } // Delete() /** * \brief Generate the text for this plugin. */ public function Output() { $V = ""; /* If this is a POST, then process the request. */ $uploadpk = GetParm('upload', PARM_INTEGER); if (!empty($uploadpk)) { $V.= $this->TryToDelete($uploadpk); } /* Create the AJAX (Active HTTP) javascript for doing the reply and showing the response. */ $V.= ActiveHTTPscript("Uploads"); $V.= "\n"; /* Build HTML form */ $V.= "\n"; return $V; } } $NewPlugin = new admin_upload_delete; diff --git a/src/lib/php/Plugin/DefaultPlugin.php b/src/lib/php/Plugin/DefaultPlugin.php index ebdd6044..9aec619d 100644 --- a/src/lib/php/Plugin/DefaultPlugin.php +++ b/src/lib/php/Plugin/DefaultPlugin.php @@ -1,423 +1,422 @@ name = $name; foreach ($parameters as $key => $value) { $this->setParameter($key, $value); } global $container; $this->container = $container; $this->session = $this->getObject('session'); $this->renderer = $this->getObject('twig.environment'); $this->logger = $this->getObject('logger'); $this->menu = $this->getObject('ui.component.menu'); $this->microMenu = $this->getObject('ui.component.micromenu'); } private function setParameter($key, $value) { switch ($key) { case self::TITLE: $this->title = $value; break; case self::PERMISSION: $this->permission = $value; break; case self::REQUIRES_LOGIN: $this->requiresLogin = $value; break; case self::LEVEL: $this->PluginLevel = $value; break; case self::DEPENDENCIES: $this->dependencies = $value; break; case self::INIT_ORDER: $this->InitOrder = $value; break; case self::MENU_LIST: $this->MenuList = $value; break; case self::MENU_ORDER: $this->MenuOrder = $value; break; case self::MENU_TARGET: $this->MenuTarget = $value; break; default: throw new \Exception("unhandled parameter $key in module " . $this->name); } } /** * @return string */ public function getName() { return $this->name; } /** * @return string */ public function getVersion() { return $this->version; } /** * @return string */ public function getTitle() { return $this->title; } /** * @return int */ public function isRequiresLogin() { return $this->requiresLogin; } /** * @return array */ public function getDependency() { return $this->dependencies; } /** * @return int */ public function getPluginLevel() { return $this->PluginLevel; } /** * @return int */ public function getDBaccess() { return $this->permission; } /** * @return int */ public function getState() { return PLUGIN_STATE_READY; } /** * @return int */ public function getInitOrder() { return $this->InitOrder; } public function getNoMenu() { return 0; } /** * \brief Customize submenus. */ protected function RegisterMenus() { if (isset($this->MenuList) && (!$this->requiresLogin || $this->isLoggedIn())) { menu_insert("Main::" . $this->MenuList, $this->MenuOrder, $this->name, $this->name); } } /** * @return Response */ public function getResponse() { $request = Request::createFromGlobals(); $request->setSession($this->session); $this->checkPrerequisites(); $startTime = microtime(true); $response = $this->handle($request); $response->prepare($request); $this->logger->debug(sprintf("handle request in %.3fs", microtime(true) - $startTime)); return $response; } /** * @param $name * @return object */ public function getObject($name) { return $this->container->get($name); } public function preInstall() { $this->RegisterMenus(); } public function postInstall() { } public function unInstall() { } public function execute() { $startTime = microtime(true); $response = $this->getResponse(); $this->logger->debug(sprintf("prepare response in %.3fs", microtime(true) - $startTime)); $response->send(); } /** * @param Request $request * @return Response */ protected abstract function handle(Request $request); /** * @param string $templateName * @param array $vars * @param string[] $headers * @return Response */ protected function render($templateName, $vars = null, $headers = null) { if ($this->requiresLogin && !$this->isLoggedIn()) { new Response("permission denied", Response::HTTP_FORBIDDEN, array("contentType" => "text/plain")); } $startTime = microtime(true); $content = $this->renderer->loadTemplate($templateName) ->render($vars ?: $this->getDefaultVars()); $this->logger->debug(sprintf("%s: render response in %.3fs", get_class($this), microtime(true) - $startTime)); return new Response( $content, Response::HTTP_OK, $headers ?: $this->getDefaultHeaders() ); } public function isLoggedIn() { return (!empty($_SESSION[Auth::USER_NAME]) && $_SESSION[Auth::USER_NAME] != 'Default User'); } private function checkPrerequisites() { if ($this->requiresLogin && !$this->isLoggedIn()) { throw new \Exception("not allowed without login"); } foreach ($this->dependencies as $dependency) { $id = plugin_find_id($dependency); if ($id < 0) { $this->unInstall(); throw new \Exception("unsatisfied dependency '$dependency' in module '" . $this->getName() . "'"); } } } /** * @return array */ protected function getDefaultHeaders() { return array( 'Content-type' => 'text/html', 'Pragma' => 'no-cache', 'Cache-Control' => 'no-cache, must-revalidate, maxage=1, post-check=0, pre-check=0', 'Expires' => 'Expires: Thu, 19 Nov 1981 08:52:00 GMT'); } /** * @return array */ protected function getDefaultVars() { $vars = array(); $metadata = "\n"; $metadata .= "\n"; $vars['metadata'] = $metadata; if (!empty($this->title)) { $vars[self::TITLE] = htmlentities($this->title); } $styles = "\n"; $styles .= "\n"; $styles .= "\n"; $styles .= "\n"; $styles .= "\n"; $styles .= $this->menu->OutputCSS(); $vars['styles'] = $styles; $vars['menu'] = $this->menu->Output($this->title); global $SysConf; if (array_key_exists('BUILD', $SysConf)) { $vars['versionInfo'] = array( 'version' => $SysConf['BUILD']['VERSION'], 'buildDate' => $SysConf['BUILD']['BUILD_DATE'], 'commitHash' => $SysConf['BUILD']['COMMIT_HASH'], - 'commitDate' => $SysConf['BUILD']['COMMIT_DATE'] + 'commitDate' => $SysConf['BUILD']['COMMIT_DATE'], + 'branchName' => $SysConf['BUILD']['BRANCH'] ); } return $vars; } protected function mergeWithDefault($vars) { return array_merge($this->getDefaultVars(), $vars); } protected function flushContent($content) { return $this->render("include/base.html.twig",$this->mergeWithDefault(array("content"=>$content))); } /** * @param string $name * @throws \Exception * @return string|null */ public function __get($name) { if (method_exists($this, ($method = 'get' . ucwords($name)))) { return $this->$method(); } else { throw new \Exception("property '$name' not found in module " . $this->name); } } function __toString() { return getStringRepresentation(get_object_vars($this), get_class($this)); } - - } diff --git a/src/lib/php/Plugin/FO_Plugin.php b/src/lib/php/Plugin/FO_Plugin.php index 72ea3b42..aec6322a 100644 --- a/src/lib/php/Plugin/FO_Plugin.php +++ b/src/lib/php/Plugin/FO_Plugin.php @@ -1,510 +1,510 @@ $NoneText, Auth::PERM_READ => $ReadText, Auth::PERM_WRITE => $WriteText, Auth::PERM_ADMIN => $AdminText); /** * \class FO_Plugin * \brief This is the Plugin class. All plugins should: * 1. Use this class or extend this class. * 2. After defining the necessary functions and values, the plugin * must add the new element to the Plugins array. * For example: * $NewPlugin = new Plugin; * $NewPlugin->Name="Fred"; * if ($NewPlugin->Initialize() != 0) { destroy $NewPlugin; } */ class FO_Plugin implements Plugin { /** * All public fields can be empty, indicating that it does not apply. */ var $State = PLUGIN_STATE_INVALID; /** * Name defines the official name of this plugin. Other plugins may * call this plugin based on this name. */ var $Name = ""; var $Version = "1.0"; var $Title = ""; // used for HTML title tags and window menu bars /** * Access level restrictions */ var $DBaccess = PLUGIN_DB_NONE; /* what kind of access is needed? */ var $LoginFlag = 0; /* Must you be logged in to access this plugin? 1=yes, 0=no */ /** * Common for HTML output */ var $NoMenu = 0; /* 1 = Don't show the HTML menu at the top of page */ var $NoHeader = 0; /* 1 = Don't show the HTML header at the top of page */ /** * This array lists plugin dependencies by name and initialization order. * These are used to call PostInitialize in the correct order. * PostInitialize will be called when all dependencies are ready. * InitOrder says "after all dependencies are ready, do higher value * items first." For example, this allows for menus to be initialized * before anything else. (You probably won't need to change InitOrder.) */ var $PluginLevel = 10; /* used for sorting plugins -- higher comes first after dependencies are met */ var $Dependency = array(); var $InitOrder = 0; /** @var Menu */ private $menu; /** @var MicroMenu */ protected $microMenu; /** @var Twig_Environment */ protected $renderer; /** @var Request|NULL */ private $request; /** @var string[] */ private $headers = array(); protected $vars = array(); /** * Plugins may define a menu item. * The menu name defines where it belongs. * Each menu item belongs in a category (menu list) and could be in * subcategories (menu sublists). The MenuList identifies * the list (and sublists) where this item belongs. The menu heirarchy * is defined by a name and a "::" to denote a submenu item. * * The MenuName defines the name for this item in the menu. * * Finally, multiple plugins may place multiple items under the same menu. * The MenuOrder assigns a numeric ranking for items. All items * at the same level are sorted alphabetically by MenuName. * * For example, to define an "About" menu item under the "Help" menu: * $MenuList = "Help::About"; * $MenuOrder=0; * And a "delete" agent under the tool, administration menu would be: * $MenuList = "Tools::Administration::Delete"; * $MenuOrder=0; * * Since menus may link to results that belong in a specific window, * $MenuTarget can identify the window. If not defined, the UI will use * a default results window. * * /note * 1. If the MenuList location does not exist, then it will be created. * 2. If a plugin does not have a menulist item, then it will not appear * in any menus. * 3. MenuList is case and SPACE sensitive. "Help :: About" defines * "Help " and " About". While "Help::About" defines "Help" and "About". */ var $MenuList = NULL; var $MenuOrder = 0; var $MenuTarget = NULL; /** * These next variables define required functionality. * If the functions exist, then they are called. However, plugins are * not required to define any of these. */ /** * \brief This function (when defined) is only called when * the plugin is first installed. It should make sure all * requirements are available and create anything it needs to run. * It returns 0 on success, non-zero on failure. * A failed install is not inserted in the system. * * \note It may be called multiple times. It must check that * changes are needed BEFORE doing any changes. * Also, it must check for partial installs in case the user is * recovering from an installation failure. */ function Install() { return 0; } /** * \brief This function (when defined) is only called once, * when the plugin is removed. It should uninstall and remove * all items that are only used by this plugin. There should be * no residues -- if the plugin is ever installed again, it should * act like a clean install. Thus, any DB, files, or state variables * specific to this plugin must be removed. * This function must always succeed. */ function Remove() { return; } /** * \brief base constructor. Most plugins will just use this * * Makes sure the plugin is in the correct state. If so, the plugin is * inserted into the Plugins data structure. * * The constructor assumes that Install() was already run one time (possibly * years ago and not during this object's creation). * * \return true on success, false on failure. * * On failure the plugin is not used by the system. NOTE: This function must * NOT assume that other plugins are installed. See PostInitialize. */ public function __construct() { $this->OutputType = $this->OutputType ?: "HTML"; $this->State = PLUGIN_STATE_VALID; register_plugin($this); global $container; $this->menu = $container->get('ui.component.menu'); $this->microMenu = $container->get('ui.component.micromenu'); $this->renderer = $container->get('twig.environment'); } /** * \brief dummy stub till all references are removed. */ function Initialize() { return (TRUE); } // Initialize() /** * \brief This function is called before the plugin * is used and after all plugins have been initialized. * If there is any initialization step that is dependent on other * plugins, put it here. * * \return true on success, false on failure. * * \note Do not assume that the plugin exists! Actually check it! */ function PostInitialize() { if ($this->State != PLUGIN_STATE_VALID) { return 0; } // don't run if (empty($_SESSION['User']) && $this->LoginFlag) { return 0; } // Make sure dependencies are met foreach ($this->Dependency as $key => $val) { $id = plugin_find_id($val); if ($id < 0) { $this->Destroy(); return (0); } } // Put your code here! // If this fails, set $this->State to PLUGIN_STATE_INVALID. // If it succeeds, then set $this->State to PLUGIN_STATE_READY. // It worked, so mark this plugin as ready. $this->State = PLUGIN_STATE_READY; // Add this plugin to the menu if ($this->MenuList !== "") { menu_insert("Main::" . $this->MenuList, $this->MenuOrder, $this->Name, $this->MenuTarget); } return ($this->State == PLUGIN_STATE_READY); } // PostInitialize() /** * \brief While menus can be added to any time at or after * the PostInitialize phase, this is the standard location for * registering this item with menus. * * \note 1: Menu registration may be plugin specific! * \note 2: This is intended for cross-plugin registration and not * for the main menu. */ function RegisterMenus() { if ($this->State != PLUGIN_STATE_READY) { return (0); } // don't run // Add your own menu items here. // E.g., menu_insert("Menu_Name::Item"); } /** * \brief This is a destructor called after the plugin * is no longer needed. It should assume that PostInitialize() was * already run one time (this session) and succeeded. * This function must always succeed. */ function Destroy() { $this->State = PLUGIN_STATE_INVALID; } /** * The output functions generate "output" for use in a text CLI or web page. * For agents, the outputs generate status information. */ /* Possible values: Text, HTML, XML, JSON */ var $OutputType = "HTML"; var $OutputToStdout = 0; /** * \brief This function is called when user output is * requested. This function is responsible for assigning headers. * * @internal param $vars */ function OutputOpen() { if ($this->State != PLUGIN_STATE_READY) { return (0); } $this->headers['Content-type'] = 'text/html'; $this->headers['Pragma'] = 'no-cache'; $this->headers['Cache-Control'] = 'no-cache, must-revalidate, maxage=1, post-check=0, pre-check=0'; $this->headers['Expires'] = 'Expires: Thu, 19 Nov 1981 08:52:00 GMT'; $metadata = "\n"; $metadata .= "\n"; $this->vars['metadata'] = $metadata; if (!empty($this->Title)) { $this->vars['title'] = htmlentities($this->Title); } $styles = "\n"; $styles .= "\n"; $styles .= "\n"; $styles .= "\n"; $styles .= "\n"; if ($this->NoMenu == 0) { $styles .= $this->menu->OutputCSS(); } $this->vars['styles'] = $styles; if ($this->NoMenu == 0) { $this->vars['menu'] = $this->menu->Output($this->Title); } global $SysConf; $this->vars['versionInfo'] = array( 'version' => $SysConf['BUILD']['VERSION'], 'buildDate' => $SysConf['BUILD']['BUILD_DATE'], 'commitHash' => $SysConf['BUILD']['COMMIT_HASH'], - 'commitDate' => $SysConf['BUILD']['COMMIT_DATE'] + 'commitDate' => $SysConf['BUILD']['COMMIT_DATE'], + 'branchName' => $SysConf['BUILD']['BRANCH'] ); } // OutputOpen() /** * @brief Similar to OutputClose, this ends the output type * for this object. However, this does NOT change any global * settings. This is called when this object is a dependency * for another object. */ function OutputUnSet() { if ($this->State != PLUGIN_STATE_READY) { return 0; } return ""; } /** * @return Response */ function getResponse() { ob_start(); $output = $this->Output(); if($output instanceof Response) { $response = $output; } else { if (empty($this->vars['content']) && $output) { $this->vars['content'] = $output; } elseif (empty($this->vars['content'])) { $this->vars['content'] = ob_get_contents(); } $response = $this->render($this->getTemplateName()); } ob_end_clean(); return $response; } /** * @brief This function is called when user output is * requested. This function is responsible for content. * (OutputOpen and Output are separated so one plugin * can call another plugin's Output.) */ function Output() { return new Response("ERROR: Output() method of FO_Plugin not defined in class '" . get_class($this) . "'", Response::HTTP_INTERNAL_SERVER_ERROR); } public function getTemplateName() { return "include/base.html.twig"; } /** * @param string $templateName * @param array $vars * @return string */ public function renderString($templateName, $vars = null) { return $this->renderer->loadTemplate($templateName)->render($vars ?: $this->vars); } /** * @param string $templateName * @param array $vars * @return Response */ protected function render($templateName, $vars = null) { $content = $this->renderString($templateName, $vars); return new Response( $content, Response::HTTP_OK, $this->headers ); } /** * @return Request */ public function getRequest() { if (!isset($this->request)) { $this->request = Request::createFromGlobals(); } return $this->request; } public function execute() { $this->OutputOpen(); $response = $this->getResponse(); $response->prepare($this->getRequest()); $response->send(); } function preInstall() { if ($this->State == PLUGIN_STATE_VALID) { $this->PostInitialize(); } if ($this->State == PLUGIN_STATE_READY) { $this->RegisterMenus(); } } function postInstall() { $state = $this->Install(); if ($state != 0) { throw new Exception("install of plugin " . $this->Name . " failed"); } } function unInstall() { $this->Destroy(); } public function getName() { return $this->Name; } function __toString() { return getStringRepresentation(get_object_vars($this), get_class($this)); } - } diff --git a/src/lib/php/UI/Component/Menu.php b/src/lib/php/UI/Component/Menu.php index fc24ebd3..d72f9eca 100644 --- a/src/lib/php/UI/Component/Menu.php +++ b/src/lib/php/UI/Component/Menu.php @@ -1,330 +1,330 @@ Documentation"); $this->renderer = $renderer; } /** * \brief Recursively generate the menu in HTML. */ function menu_html(&$menu, $indent) { if (empty($menu)) { return; } $output = ""; $output .= "\n"; $output .= " \n"; $output .= "\n"; return preg_replace("|{{ "The folder properties that can be changed are the folder name and description."|trans }} {{ "First select the folder to edit. Then enter the new values."|trans }} {{ "If no value is entered, then the corresponding field will not be changed."|trans }}
diff --git a/src/www/ui/template/admin_upload_edit.html.twig b/src/www/ui/template/admin_upload_edit.html.twig index fe4470f5..74f0fdd3 100644 --- a/src/www/ui/template/admin_upload_edit.html.twig +++ b/src/www/ui/template/admin_upload_edit.html.twig @@ -1,51 +1,51 @@ {# Copyright 2015 Siemens AG Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. #} {% extends "include/base.html.twig" %} {% block content %} {% endblock %} {% block foot %} {{ parent() }} {% endblock %} diff --git a/src/www/ui/template/agent_adder.html.twig b/src/www/ui/template/agent_adder.html.twig index adbd93cf..072f3c12 100644 --- a/src/www/ui/template/agent_adder.html.twig +++ b/src/www/ui/template/agent_adder.html.twig @@ -1,77 +1,77 @@ {# Copyright 2014-2015 Siemens AG Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. #} {% extends "include/base.html.twig" %} {% block content %} {% endblock %} {% block foot %} {{ parent() }} {% if uploadId %} {% endif %} {{ uploadScript }} {{ agentScript }} {{ outFoot }} {% endblock %} diff --git a/src/www/ui/template/components/menu.html.twig b/src/www/ui/template/components/menu.html.twig index 23ed730a..af9e0e26 100644 --- a/src/www/ui/template/components/menu.html.twig +++ b/src/www/ui/template/components/menu.html.twig @@ -1,52 +1,53 @@ {# Copyright 2014-2015 Siemens AG Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. #} {% if bannerMsg %}
|
{{ mainMenu }} | ||||
{{ title }}
{% if versionInfo %} {# versionInfo contains all the variables defined at build time in the [BUILD] section of /VERSION #} - {{ versionInfo.version }}, commit: [#{{ versionInfo.commitHash }}] {{ versionInfo.commitDate }} built @ {{ versionInfo.buildDate }} + {% set extractVersion = versionInfo.version|split('-') %} + Version: [{{ extractVersion[0] }}], Branch: [{{ versionInfo.branchName }}], Commit: [#{{ versionInfo.commitHash }}] {{ versionInfo.commitDate }} built @ {{ versionInfo.buildDate }} {% endif %} |
{% if isLoggedOut %}
{% if isLoginPage %}{{ 'Login'|trans }}{% else %}{{ 'Login'|trans }}{% endif %}
{% else %}
logout
|