database = array(); $this->errors = array(); $this->dictFiles = array(); } function addFile($dictFile) { array_push($this->dictFiles,array("path"=>dirname($dictFile),"filename"=>basename($dictFile))); $this->parse($dictFile); if (count($this->errors)>0) { return false; } else { return true; } } function parse($dictFile) { if (!$file = @file($dictFile)) { array_push($this->errors,"Failed to open '$dictFile'"); } foreach ($file as $key=>$value) { $key = addslashes($key); $value = addslashes($value); if ( trim($value) != '' && substr(ltrim($value), 0, 1) != '#' ) { if (strpos(strtolower($value),'import')>0) { $g = array(); preg_match('/^\s*@import\s+["\']([^"]+)["\']/i',stripslashes($value),$g); if (count($g) > 0) { $this->parse($this->dictFiles[count($this->dictFiles)-1]['path'] . '/' . $g[1]); } } else { list($dictKey,$dictValue) = explode('=',$value); if ($dictKey != '' && $dictValue !='') { $this->database[strtolower($dictKey)] = rtrim($dictValue); } } } } } function get($key,$params=array()) { $key = addslashes($key); if ( isset($this->database[strtolower($key)]) ) { $value = $this->database[strtolower($key)]; if (substr($value,0,1) == '$') { $value = $this->get(substr($value,1)); } if ( count($params) > 0 ) { $arrKeys = array_keys($params); $arrVals = array_values($params); for ( $i=0; $idatabase)) { return $key; } else { $value = $this->database[strtolower($key)]; if (substr($value,0,1) == '$') { $value = $this->get(substr($value,1)); } $value = str_replace(array_keys($params),array_values($params),$value); $value = preg_replace("/\{[0-9]{1}\}/i","",$value); $value = str_replace(" "," ",$value); return stripslashes($value); } */ } } function NOF_fileExists($incfile) { global $nof_suiteName; if (file_exists($incfile)) { return true; } else { NOF_throwError(103,array("{1}"=>NOF_mapPath($incfile),"{2}"=>$nof_suiteName),false); return false; } } function NOF_throwError($code,$params=array(),$stop=true) { global $nof_resources; if($GLOBALS["nof_debug"] == "true") { echo "

" . $nof_resources->get("Error.".$code,$params) . "

"; } else { echo "

" . $nof_resources->get("Error.Text.Generic") . "

" . $nof_resources->get("Error.Text.Code") . " $code

"; } if ($stop) { exit(); } } // c: / inetpub / wwwroot / texte / formshandler // .. / db / .. / scripts / . // ..(getcwd) / db / function NOF_mapPath($path) { // if $path is already a path, return it as is if ($path[0] == '/' || $path[1] == ':') { return addslashes($path); } // if $path exists, it's quite easy if ($mapPath = realpath(($path))) { return addslashes($mapPath); } else { // get current directory as full path $dir = getcwd(); // workaround on path separator if (strpos($dir,'\\')>0) { $pathSep = '\\'; $path = str_replace('/',$pathSep,$path); } else { $pathSep = '/'; $path = str_replace('\\',$pathSep,$path); } // build a full path $mapPath = $dir . $pathSep . $path; // split it $mapDirs = explode($pathSep,$mapPath); // treat . and .. for ($i=0;$i', '

', "
"); $htmlEntitiesValue = array('\r\n', '\r\n', '\r\n'); for ( $i=0; $i