Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E848919BB8 for ; Fri, 25 Mar 2016 20:48:48 +0000 (UTC) Received: (qmail 8941 invoked by uid 500); 25 Mar 2016 20:48:48 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 8857 invoked by uid 500); 25 Mar 2016 20:48:48 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 7130 invoked by uid 99); 25 Mar 2016 20:48:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2016 20:48:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E1121E083B; Fri, 25 Mar 2016 20:48:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: scnakandala@apache.org To: commits@airavata.apache.org Date: Fri, 25 Mar 2016 20:49:06 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [21/40] airavata-php-gateway git commit: ammending the last commit ammending the last commit Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/7a825b33 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/7a825b33 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/7a825b33 Branch: refs/heads/master Commit: 7a825b33bb3f42e9224071a700af08c2befa39de Parents: 3e6d93b Author: scnakandala Authored: Wed Mar 23 17:49:49 2016 -0400 Committer: scnakandala Committed: Wed Mar 23 17:49:49 2016 -0400 ---------------------------------------------------------------------- app/libraries/ExperimentUtilities.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7a825b33/app/libraries/ExperimentUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php index 872cf71..78403ac 100644 --- a/app/libraries/ExperimentUtilities.php +++ b/app/libraries/ExperimentUtilities.php @@ -73,7 +73,7 @@ class ExperimentUtilities $order[$index] = $input->inputOrder; } array_multisort($order, SORT_ASC, $experimentInputs); - + $html = ""; foreach ($experimentInputs as $input) { $matchingAppInput = null; @@ -88,15 +88,23 @@ class ExperimentUtilities break; } } - $filePath = str_replace($hostPathConstant . Config::get("pga_config.airavata")["experiment-data-absolute-path"], "", $currentInputPath); - echo '

' . basename($filePath) . - '

'; + $dataRoot = Config::get("pga_config.airavata")["experiment-data-absolute-path"]; + if(!ExperimentUtilities::endsWith($dataRoot, "/")) + $dataRoot += "/"; + $filePath = str_replace($hostPathConstant . $dataRoot . Session::get('username'), "", $currentInputPath); + $html .= '

' . basename($filePath) . '

'; } elseif ($input->type == DataType::STRING || $input->type == DataType::INTEGER || $input->type == DataType::FLOAT) { - echo '

' . $input->name . ': ' . $input->value . '

'; + $html .= '

' . $input->name . ': ' . $input->value . '

'; } } + + return $html; + } + + private static function endsWith($haystack, $needle) { + // search forward starting from end minus needle length characters + return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false); } /**