:String - Directory to be listed. :Int - Level of subdirectories to be listed. Default = 0 (no subdirectories) :String - Sort data on: 'name'(default), 'size', 'date' of 'type'. :Boolean - Reverse data (true or false(default)) $ld = new ListDir(, , ); $ld->getList(, ); $ld->displayXml(, ); getList:Array - Returns multidimensional array. array (0 => array ( 'name' => 'img', 'type' => 'dir', 'date' => 1234214523, 'list' => array ( 0 => array ( 'name' => 'image.jpg', 'type' => 'file', 'date' => 1233524541, 'size' => 12485 ))), 1 => array ( 'name' => 'index.html', 'type' => 'file', 'date' => 1234214523, 'size' => 245 )); etc... displayXml:Xml - returns xml headers and data. image.jpg index.html */ class ListDir { var $dir; var $level; var $sort_on = 'name'; var $reversed = false; var $list = array(); var $knowntypes = array("css", "doc", "exe", "flv", "gif", "html", "jpg", "mp3", "pdf", "php", "png", "ppt", "psd", "swf", "txt", "xls", "zip"); var $allowedtypes = array(); // -------------------------------- // CONSTRUCTOR // -------------------------------- function ListDir($dir, $level = 0, $types = array()) { $this->dir = $dir; $this->level = $level; $this->allowedtypes = $types; $this->list = $this->_list($dir, 0); } // -------------------------------- // LIST A DIREACTORY // -------------------------------- function _list($dir, $dlevel) { if(substr($dir, -1) != '/') $dir .= '/'; if(!is_dir($dir)) return "$dir is not a directory"; $dlevel++; if($this->level < $dlevel - 1) return array(); $list = array(); if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if($file == '.' || $file == '..') continue; $bestand = array(); $bestand['name'] = $file; $bestand['type'] = filetype($dir . $file); $bestand['date'] = filemtime($dir . $file); $bestand['path'] = $dir; if($bestand['type'] == 'file') { $bestand['size'] = filesize($dir . $file); $ext = pathinfo($file, PATHINFO_EXTENSION); $ext = strtolower($ext); if(in_array($ext, $this->knowntypes)) $bestand['type'] = $ext; if($ext == 'jpeg') $bestand['type'] = 'jpg'; if($bestand['type'] == 'jpg' || $bestand['type'] == 'gif' || $bestand['type'] == 'png'){ list($width, $height, $type, $attr) = getimagesize($dir . $file); $bestand['width'] = $width; $bestand['height'] = $height; } if($bestand['type'] == 'php' || $bestand['type'] == 'inc' || $bestand['type'] == 'mdu') continue; } if(!in_array($bestand['type'], $this->allowedtypes) && !empty($this->allowedtypes)) continue; if($bestand['type'] == 'dir') $bestand['list'] = $this->_list($dir . $file . '/', $dlevel); $list[] = $bestand; } closedir($dh); } return $list; } // -------------------------------- // GET DIRECTORY LIST // -------------------------------- function getList($sort_on = 'name', $reversed = false) { $this->sort_on = $sort_on; $this->reversed = $reversed; $this->_sortList($this->list); return $this->list; } // -------------------------------- // DISPLAY DIRECTORY LIST IN XML // -------------------------------- function displayXML($sort_on = 'name', $reversed = false) { $this->sort_on = $sort_on; $this->reversed = $reversed; $this->_sortList($this->list); header("Content-type: text/xml"); echo($this->_getXML()); exit(); } // -------------------------------- // CREATE XML STING // -------------------------------- function _getXML() { $dir_name = realpath($this->dir); $dir_name = substr( $dir_name, strlen($_SERVER['DOCUMENT_ROOT']) ); $xml = ""; $xml .= ''; $xml .= $this->_xmlDir($this->list); $xml .= ""; return $xml; } // -------------------------------- // XML DIRECTORY // -------------------------------- function _xmlDir(&$list) { $xml = ""; foreach($list as $nr => $file) { if($file['type'] == 'dir'){ $xml .= ""; $xml .= $this->_xmlDir($file['list']); $xml .= "\n"; }else{ $xml .= "\n"; } } return $xml; } // -------------------------------- // SORT DA LIST // -------------------------------- function _sortList(&$list) { usort($list, array('ListDir', 'compare')); // sort sub directories foreach($list as $nr => $file){ if($file['type'] == 'dir'){ $this->_sortList($list[$nr]['list']); } } } function compare($x, $y) { // altijd directories eerst, dan sorteren op $this->sort_on if ( $x['type'] == 'dir' && $y['type'] != 'dir'){ return -1; } elseif( $x['type'] != 'dir' && $y['type'] == 'dir'){ return 1; } else { if ( $x['name'] == $y['name'] ) return 0; return (strtolower($x['name']) < strtolower($y['name'])) ? -1 : 1; /* // $this bestaat niet??? if ( $x[$this->sort_on] == $y[$this->sort_on] ) return 0; elseif ( $x[$this->sort_on] < $y[$this->sort_on] ) return ($this->reversed)? 1:-1; else return ($this->reversed)? -1:1; */ } } } ?> RecensiesIl Senso - Italiaans Restaurant in Den Haag

Recensies

Il Senso reviewed

I visited "IL Senso" for the first time 2 weeks ago and I would like to share my first impressions.

The restaurant is definitely an excellent place to experience the real Italian "wining and dining" culture! The food is outstanding; the menu is a wonderful selection of seafood, meat and pastas, representing the variety and beauty of the Italian cuisine! The wine menu is rich, including wines from almost every region in Italy (I was pleasantly surprised to see a few wines from the region Marche, something really untypical for most of the Italian restaurants I have visited so far)!

Everything mentioned so far, accompanied with the cosy and warm atmosphere, and the professional and friendly service, made my visit at "IL Senso" one of the most delightful evenings during my stay in The Hague!

Definitely, a place I will visit again!

ALRS (Iens)

We booked a dinner at Il senso for our 3rd wedding anniversary. we were looking for a romantic restaurant with a cozy atmosphere, delicious food!

Nathalie Kanaan Ismail (Diningcity)