if read only edit disabled
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/70f85239 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/70f85239 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/70f85239 Branch: refs/heads/dreg-gateway Commit: 70f85239e69d9b12aac9b66683af75517e824321 Parents: ae38aa9 Author: scnakandala <supun.nakand...@gmail.com> Authored: Wed Feb 15 16:35:39 2017 -0500 Committer: scnakandala <supun.nakand...@gmail.com> Committed: Wed Feb 15 16:35:39 2017 -0500 ---------------------------------------------------------------------- app/libraries/ExperimentUtilities.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/70f85239/app/libraries/ExperimentUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php index 12718f1..8248851 100755 --- a/app/libraries/ExperimentUtilities.php +++ b/app/libraries/ExperimentUtilities.php @@ -784,11 +784,15 @@ class ExperimentUtilities //var_dump( $inputs); exit; foreach ($inputs as $input) { + $disabled = ""; + if($input->isReadOnly) + $disabled = "disabled"; + switch ($input->type) { case DataType::STRING: echo '<div class="form-group"> <label for="experiment-input">' . $input->name . '</label> - <input value="' . $input->value . '" type="text" class="form-control" name="' . $input->sanitizedFormName . + <input '.$disabled . ' value="' . $input->value . '" type="text" class="form-control" name="' . $input->sanitizedFormName . '" id="' . $input->sanitizedFormName . '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '> </div>'; @@ -796,7 +800,7 @@ class ExperimentUtilities case DataType::INTEGER: echo '<div class="form-group"> <label for="experiment-input">' . $input->name . '</label> - <input value="' . $input->value . '" type="number" class="form-control" name="' . $input->sanitizedFormName . + <input '.$disabled . ' value="' . $input->value . '" type="number" class="form-control" name="' . $input->sanitizedFormName . '" id="' . $input->sanitizedFormName . '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '> </div>'; @@ -804,7 +808,7 @@ class ExperimentUtilities case DataType::FLOAT: echo '<div class="form-group"> <label for="experiment-input">' . $input->name . '</label> - <input value="' . $input->value . '" type="number" step="0.01" class="form-control" name="' . $input->sanitizedFormName . + <input '.$disabled . ' value="' . $input->value . '" type="number" step="0.01" class="form-control" name="' . $input->sanitizedFormName . '" id="' . $input->sanitizedFormName . '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '> </div>';