diff options
author | Colin Smith <colin@pfsense.org> | 2005-06-26 04:39:30 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-06-26 04:39:30 +0000 |
commit | 2fe6c52bcee7c3adbe9953e76aecf8eefba463d6 (patch) | |
tree | b2c452c355fe3e06cd4c99c375d14b30d3906b89 /usr | |
parent | fce971e128f1490c7475398dde47d3976a1a2f83 (diff) | |
download | pfsense-2fe6c52bcee7c3adbe9953e76aecf8eefba463d6.zip pfsense-2fe6c52bcee7c3adbe9953e76aecf8eefba463d6.tar.gz |
Add field greyout.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/pkg_edit.php | 50 |
1 files changed, 45 insertions, 5 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index bb4ea4e..65fbf25 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -114,9 +114,7 @@ if ($_POST) { </head> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<?php -include("fbegin.inc"); -?> +<?php include("fbegin.inc"); ?> <p class="pgtitle"><?=$title?></p> <?php } @@ -218,8 +216,50 @@ include("fbegin.inc"); <link href="gui.css" rel="stylesheet" type="text/css"> </head> -<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> - +<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onLoad="enablechange();"> +<?php if($pkg['fields']['field'] <> "") { ?> +<script language="JavaScript"> +<!-- +function enablechange() { +<?php + foreach($pkg['fields']['field'] as $field) { + if(isset($field['enablefields']) or isset($field['checkenablefields'])) { + print "\t" . 'if (document.iform.' . strtolower($field['name']) . '.checked == false) {' . "\n"; + if(isset($field['enablefields'])) { + $enablefields = explode(',', $field['enablefields']); + foreach($enablefields as $enablefield) { + $enablefield = strtolower($enablefield); + print "\t\t" . 'document.iform.' . $enablefield . '.disabled = 1;' . "\n"; + } + } + if(isset($field['checkenablefields'])) { + $checkenablefields = explode(',', $field['checkenablefields']); + foreach($checkenablefields as $checkenablefield) { + $checkenablefield = strtolower($checkenablefield); + print "\t\t" . 'document.iform.' . $checkenablefield . '.checked = 0;' . "\n"; + } + } + print "\t" . '} else {' . "\n"; + if(isset($field['enablefields'])) { + foreach($enablefields as $enablefield) { + $enablefield = strtolower($enablefield); + print "\t\t" . 'document.iform.' . $enablefield . '.disabled = 0;' . "\n"; + } + } + if(isset($field['checkenablefields'])) { + foreach($checkenablefields as $checkenablefield) { + $checkenablefield = strtolower($checkenablefield); + print "\t\t" . 'document.iform.' . $checkenablefield . '.checked = 1;' . "\n"; + } + } + print "\t" . '}' . "\n"; + } + } +?> +} +//--> +</script> +<?php } ?> <script type="text/javascript" language="javascript" src="row_helper_dynamic.js"> </script> |