_config = $config; if ( isset ( $this -> _config[ 'portal' ][ 'website' ] ) ) { $this -> setWebsite ( $this -> _config[ 'portal' ][ 'website' ] ); } } private function setWebsite( $website ) { $return_array = array ( ); $tmp_array = array_flip ( $website[ 'navId' ] ); foreach ( $tmp_array as $key => $value ) { foreach ( $website as $tmp_key => $tmp_value ) { $return_array[ $key ][ $tmp_key ] = $website[ $tmp_key ][ $value ]; } } $this -> _website = $return_array; } public function setPrefix( $prefix ) { $this -> _prefix = $prefix; } public function setPathTpl( $pathTpl ) { if ( is_dir ( $pathTpl . $this -> _prefix ) ) { $this -> _pathTpl = $pathTpl . $this -> _prefix . '/'; } else { throw new Exception( 'Template Path does not exist' ); } } public function setTemplate( $template ) { if ( file_exists ( $this -> _pathTpl . 'tpl_' . $template . '.php' ) ) { $this -> _template = $this -> _pathTpl . 'tpl_' . $template . '.php'; } else { throw new Exception( 'Template "' . $this -> _pathTpl . 'tpl_' . $template . '.php" does not exist' ); } } public function setSiteId( $siteId ) { $this -> _siteId = $siteId; } public function setEditable( $editable ) { $this -> _editable = $editable; } public function setErrors( $error ) { $this -> _error = $error; } public function setWebkey( $webkey ) { $this -> _webkey = $webkey; } public function setNavpath( $navpath ) { $this -> _navpath = $navpath; } public function setData( $data , $param = null ) { $this -> _data = $data; $this -> _param = $param; } public function setSpecialSite( $specialSite ) { $this -> _specialSite = $specialSite; } public function setFormdata( $formdata ) { $this -> _formdata = $formdata; } public function setError( $error ) { $this -> _error = $error; } public function setLang( $lang ) { $this -> _lang = $lang; } public function output( ) { ob_start( ); require $this -> _template; return ob_get_clean( ); } } ?>