diff options
author | Eudyptula <eitan@mosenkis.net> | 2009-07-13 16:26:49 -0400 |
---|---|---|
committer | Eudyptula <eitan@mosenkis.net> | 2009-07-13 16:26:49 -0400 |
commit | 2f63d9014665451e87d669ee14a8be9308e91856 (patch) | |
tree | 016c06c4683086e94602a4480b97ae730c232eec /frontend/classes | |
parent | Added data verification to config wizard API (diff) | |
download | ingenue-2f63d9014665451e87d669ee14a8be9308e91856.tar.gz ingenue-2f63d9014665451e87d669ee14a8be9308e91856.tar.bz2 ingenue-2f63d9014665451e87d669ee14a8be9308e91856.zip |
Added 'Show checked' link for package adder, fixed package selector verification, added basic verification frontend
Diffstat (limited to 'frontend/classes')
-rw-r--r-- | frontend/classes/wizard_api.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/frontend/classes/wizard_api.php b/frontend/classes/wizard_api.php index c0d91b0..48fe637 100644 --- a/frontend/classes/wizard_api.php +++ b/frontend/classes/wizard_api.php @@ -259,7 +259,9 @@ class wizard_layered_checkbox_array extends wizard_checkbox_array { public function verify() { if (($vals=self::get_opt($this->optname)) === null) return false; $vals=explode($this->delim, $vals); - return count($this->r_verify($vals, $this->array)) == 0; + $r=$this->r_verify($vals, $this->array); + debug('wlca', 'got results: '.implode(' ',$r)); + return count($r) == 0; } private function r_output(&$array, $depth=0, $path=null, $name=null) { static $uid=0, $ucid=0; @@ -279,7 +281,7 @@ class wizard_layered_checkbox_array extends wizard_checkbox_array { if (!isset($conf['id'])) { $conf['id']=self::b36($uid++); } - echo 'Search: <input id="'.$conf['id'].'-q" onkeyup="wlca_search(this.value, document.getElementById(\''.$conf['id'].'\'), 0, '.$this->depth.')" /> <a href="javascript:q=document.getElementById(\''.$conf['id'].'-q\'); q.value=\'\'; q.onkeyup()">Clear</a><br/>'."\n"; + echo 'Search: <input id="'.$conf['id'].'-q" onkeyup="wlca_search(this.value, document.getElementById(\''.$conf['id'].'\'), 0, '.$this->depth.')" /> <a href="javascript:q=document.getElementById(\''.$conf['id'].'-q\'); q.value=\'\'; q.onkeyup()">Clear</a> <a href="javascript:wlca_show_checked(document.getElementById(\''.$conf['id'].'\'), 0, '.$this->depth.'); undefined">Show checked</a><br/>'."\n"; } echo '<div class="wlca'.(isset($conf['autosize'])?' autosize" style="font-size: '.pow(1.15, $autosize)*100.0.'%':'').'" id="'.$conf['id'].'">'."\n"; foreach ($array as $name => &$val) { @@ -287,7 +289,7 @@ class wizard_layered_checkbox_array extends wizard_checkbox_array { $uid++; } echo '</div>'; - echo "<script type=\"text/javascript\">\n<!--\nwlca_search(document.getElementById('{$conf['id']}-q').value, document.getElementById('{$conf['id']}'), 0, $this->depth);\n-->\n</script>\n"; + echo "<script type=\"text/javascript\">\n<!--\nif (wlca_show_checked(document.getElementById('{$conf['id']}'), 0, $this->depth) == 0) wlca_search(document.getElementById('{$conf['id']}-q').value, document.getElementById('{$conf['id']}'), 0, $this->depth);\n-->\n</script>\n"; } else { $meta=$this->metadata[$depth]; if (isset($meta['tag'])) { @@ -346,7 +348,7 @@ class wizard_layered_checkbox_array extends wizard_checkbox_array { $meta=$this->metadata[$depth]; if (isset($meta['checkbox'])) { $label=$this->format_label($array, $meta['checkbox'], $path, $name); - if ($i=array_search($label, $vals) !== false) { + if (($i=array_search($label, $vals)) !== false) { unset($vals[$i]); } } |