diff options
Diffstat (limited to 'frontend/classes')
-rw-r--r-- | frontend/classes/forms.php | 32 | ||||
-rw-r--r-- | frontend/classes/pdo.php | 8 | ||||
-rw-r--r-- | frontend/classes/wizard.php | 12 |
3 files changed, 18 insertions, 34 deletions
diff --git a/frontend/classes/forms.php b/frontend/classes/forms.php index 39843e9..daa95cf 100644 --- a/frontend/classes/forms.php +++ b/frontend/classes/forms.php @@ -10,8 +10,7 @@ abstract class form_element { echo "$this->label: "; } public function process() { - global $request; - return isset($request[$this->htmlname])?$request[$this->htmlname]:false; + return isset($_REQUEST[$this->htmlname])?$_REQUEST[$this->htmlname]:false; } public function verify($val) { return $val !== false; @@ -47,10 +46,9 @@ class select extends form_element { echo "<br/>\n"; } public function process() { - global $request; $vals=array_keys($this->options); - if (isset($request[$this->htmlname]) && is_numeric($request[$this->htmlname]) && isset($vals[$request[$this->htmlname]])) { - return $vals[$request[$this->htmlname]]; + if (isset($_REQUEST[$this->htmlname]) && is_numeric($_REQUEST[$this->htmlname]) && isset($vals[$_REQUEST[$this->htmlname]])) { + return $vals[$_REQUEST[$this->htmlname]]; } else return false; } public function verify($val) { @@ -90,11 +88,10 @@ class checkbox_array extends form_element { } } public function process() { - global $request; $val=array(); - if (isset($request[$this->htmlname])) { + if (isset($_REQUEST[$this->htmlname])) { $vals=array_keys($this->array); - foreach ($request[$this->htmlname] as $i => $null) { + foreach ($_REQUEST[$this->htmlname] as $i => $null) { $val[]=$vals[$i]; } } @@ -122,9 +119,9 @@ class checkbox_array extends form_element { class layered_checkbox_array extends checkbox_array { private $depth=0, $path_delims=array('', '/', '-'); function __construct($htmlname, $label, &$array, $delim=' ', $metadata) { - parent::__construct($htmlname, $label, &$array, $delim); + parent::__construct($htmlname, $label, $array, $delim); $this->metadata=$metadata; - for ($i=current(&$array); is_array($i); $i=current($i)) $this->depth++; + for ($i=current($array); is_array($i); $i=current($i)) $this->depth++; global $S; if (!in_array('lca', $S['scripts'])) { $S['scripts'][]='lca'; @@ -153,7 +150,7 @@ class layered_checkbox_array extends checkbox_array { } private function r_output(&$array, $depth=0, $path=null, $name=null) { static $uid=0, $ucid=0; - $conf=&$this->metadata[0]; + $S['conf']=&$this->metadata[0]; if ($depth == 0) { $search=$autosize=0; for ($i=1; $i<count($this->metadata); $i++) { @@ -166,18 +163,18 @@ class layered_checkbox_array extends checkbox_array { } } if ($search) { - if (!isset($conf['id'])) { - $conf['id']=self::b36($uid++); + if (!isset($S['conf']['id'])) { + $S['conf']['id']=self::b36($uid++); } - echo 'Search: <input id="'.$conf['id'].'-q" onkeyup="lca_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:lca_show_checked(document.getElementById(\''.$conf['id'].'\'), 0, '.$this->depth.'); undefined">Show checked</a><br/>'."\n"; + echo 'Search: <input id="'.$S['conf']['id'].'-q" onkeyup="lca_search(this.value, document.getElementById(\''.$S['conf']['id'].'\'), 0, '.$this->depth.')" /> <a href="javascript:q=document.getElementById(\''.$S['conf']['id'].'-q\'); q.value=\'\'; q.onkeyup()">Clear</a> <a href="javascript:lca_show_checked(document.getElementById(\''.$S['conf']['id'].'\'), 0, '.$this->depth.'); undefined">Show checked</a><br/>'."\n"; } - echo '<div class="lca'.(isset($conf['autosize'])?' autosize" style="font-size: '.pow(1.15, $autosize)*100.0.'%':'').'" id="'.$conf['id'].'">'."\n"; + echo '<div class="lca'.(isset($S['conf']['autosize'])?' autosize" style="font-size: '.pow(1.15, $autosize)*100.0.'%':'').'" id="'.$S['conf']['id'].'">'."\n"; foreach ($array as $name => &$val) { $this->r_output($val, $depth+1, $name, $name); $uid++; } echo '<h3 style="display: none">No results</h3></div>'; - echo "<script type=\"text/javascript\">\n<!--\nif (lca_show_checked(document.getElementById('{$conf['id']}'), 0, $this->depth) == 0) lca_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 (lca_show_checked(document.getElementById('{$S['conf']['id']}'), 0, $this->depth) == 0) lca_search(document.getElementById('{$S['conf']['id']}-q').value, document.getElementById('{$S['conf']['id']}'), 0, $this->depth);\n-->\n</script>\n"; } else { $meta=$this->metadata[$depth]; if (isset($meta['tag'])) { @@ -214,8 +211,7 @@ class layered_checkbox_array extends checkbox_array { } else { $meta=$this->metadata[$depth]; if (isset($meta['checkbox'])) { - global $request; - if (isset($request[$this->htmlname][self::b36($ucid)])) { + if (isset($_REQUEST[$this->htmlname][self::b36($ucid)])) { $r[]=$this->format_label($array, $meta['checkbox'], $path, $name); } $ucid++; diff --git a/frontend/classes/pdo.php b/frontend/classes/pdo.php deleted file mode 100644 index daf71ba..0000000 --- a/frontend/classes/pdo.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -class pdo_debug extends PDO { - function query($q, $a1=null, $a2=null, $a3=null) { - debug('pdo::query', $q); - return parent::query($q, $a1, $a2, $a3); - } -} -?> diff --git a/frontend/classes/wizard.php b/frontend/classes/wizard.php index 4d0d7b7..de37e72 100644 --- a/frontend/classes/wizard.php +++ b/frontend/classes/wizard.php @@ -1,6 +1,6 @@ <?php class wizard_step { - var $configuration, $module, $step, $title, $next, $data=array(); + public $configuration, $module, $step, $title, $next, $data=array(); function __construct(&$c, $step, $noload=false) { $this->configuration=&$c; $this->module=new module($c->module); @@ -16,13 +16,13 @@ class wizard_step { $this->next=isset($next)?$next:($this->step == $this->module->numsteps?null:$step+1); } public function output($rw=true) { - global $conf; + global $S; echo "<div class=\"wizard\" id=\"step$this->step\">"; if ($rw) echo '<form action="'.url('config/'.$this->configuration->id).'" method="post"><a style="float: right" href="'.url('config/'.$this->configuration->id.'/status').'">Status</a>'; if ($rw) { echo '<h3>Step '.$this->step.': '.$this->title."</h3>\n"; - $scale=$conf['progressbar_width']/$this->module->numsteps; + $scale=$S['conf']['progressbar_width']/$this->module->numsteps; echo '<img src="'.url('images/full.gif').'" style="border-left: 1px solid black; border-top: 1px solid black; border-bottom: 1px solid black; width: '.$this->step*$scale.'px; height: 15px" /><img src="'.url('images/empty.gif').'" style="border-right: 1px solid black; border-top: 1px solid black; border-bottom: 1px solid black; width: '.(count($this->module->steps)-$this->step)*$scale.'px; height: 15px" /><br/>'."\n"; $this->echo_buttons(); } @@ -43,8 +43,7 @@ class wizard_step { echo '</div>'."\n"; } public function process() { - global $request; - if (!isset($request['wizard_submit'][$this->step])) { + if (!isset($_REQUEST['wizard_submit'][$this->step])) { return $this->step; } $result=$this->next; @@ -91,9 +90,6 @@ class wizard_step { private function layered_checkbox_array($optname, $htmlname, $label, &$array, $delim=' ', $metadata) { $this->data[]=array(new layered_checkbox_array($htmlname, $label, $array, $delim, $metadata), $optname); } - private function query($q) { - return $GLOBALS['S']['pdo']->query($q); - } private function set_opt($opt, $val) { return $this->configuration->set_opt($opt, $val); } |