/** * Return pre-output control configuration scripts for any controls that require them. * * @return string The output of controls' pre-output HTML. */ public function pre_out_controls() { $out = ''; if ( !FormUI::$outpre ) { FormUI::$outpre = true; $out .= '<script type="text/javascript">var controls = Object();</script>'; } foreach ( $this->controls as $control ) { $out .= $control->pre_out( ); } return $out; }
/** * Return pre-output control configuration scripts for any controls that require them. * * @return string The output of controls' pre-output HTML. */ public function pre_out_controls() { $out = ''; if ( !FormUI::$outpre ) { $out .= '<script type="text/javascript">if(controls==undefined){var controls = {init:function(fn){if(fn!=undefined){controls.inits.push(fn);}else{for(var i in controls.inits){controls.inits[i]();}}},inits:[]};}</script>'; } foreach ( $this->controls as $control ) { $out .= $control->pre_out( ); } if ( !FormUI::$outpre ) { FormUI::$outpre = true; $out .= '<script type="text/javascript">controls.init();</script>'; } return $out; }