page = $bin->URL[0]; $this->baseURL = $bin->func->formatURL( $this->page ); $this->frmData = $this->getFormData( $bin->POST ); $this->frmData['err'] = array( "display" => "none", "text" => "" ); if ( $bin->module->isLoaded( "queries" ) ) { $page = $this->page; if ( isset( $bin->queries->$page ) ) $this->query = $bin->queries->$page; } } function noErr() { return ( empty( $this->frmData['err']['text'] ) && ( $this->frmStatus == 0 || $this->frmStatus == 2 ) ); } function getFormData( $data ) { $frmData = array(); foreach ( $data as $key => $value ) { $tKey = preg_replace( "#^(.+?)\|req$#i", "$1", $key ); if ( is_array( $value ) ) $frmData[$tkey] = $this->getFormData( $value ); else { $frmData[$tKey] = stripslashes( trim( $value ) ); if ( empty( $value ) ) { if ( substr_count( $key, "|req" ) > 0 ) $this->frmStatus = 1; else $this->frmStatus = ( $this->frmStatus == 1 ) ? 1 : 2; } else $this->frmStatus = ( $this->frmStatus != -1 ) ? $this->frmStatus : 0; } } return $frmData; } } ?>