showing links only to existent output files

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/27a47179
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/27a47179
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/27a47179

Branch: refs/heads/dreg-gateway
Commit: 27a47179d6a3046d25d121e2ef2484a70c9677d3
Parents: 7a8b56c
Author: scnakandala <supun.nakand...@gmail.com>
Authored: Thu Jul 27 11:51:16 2017 -0400
Committer: scnakandala <supun.nakand...@gmail.com>
Committed: Thu Jul 27 11:51:16 2017 -0400

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/27a47179/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php 
b/app/libraries/ExperimentUtilities.php
index be32e74..6abb6d6 100755
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -180,8 +180,10 @@ class ExperimentUtilities
                 if(!ExperimentUtilities::endsWith($dataRoot, "/"))
                     $dataRoot = $dataRoot . "/";
                 $filePath = str_replace($dataRoot, "", 
parse_url($output->value, PHP_URL_PATH));
-                echo '<p>' . $output->name . ':&nbsp;<a target="_blank" 
href="' . URL::to("/")
-                    . '/download/?path=' . $filePath . '">' . 
basename($filePath) . ' <span class="glyphicon 
glyphicon-new-window"></span></a></p>';
+                if(file_exists($filePath)){
+                    echo '<p>' . $output->name . ':&nbsp;<a target="_blank" 
href="' . URL::to("/")
+                        . '/download/?path=' . $filePath . '">' . 
basename($filePath) . ' <span class="glyphicon 
glyphicon-new-window"></span></a></p>';
+                }
             }
             elseif ($output->type == DataType::STRING) {
                 echo '<p>' . $output->value . '</p>';

Reply via email to