<?php

/**
 * Delete standard page
 *
 * @category   Extension (edit page)
 * @author     Nico Wenig <nico.wenig@yellowgreen.de>
 * @version	   2009-05-29
 */

	$database_folder = $system_data['folder']['database'] . 'news/';
	$news_database_file = $database_folder . $page_info->catalogue;
	
	if(is_file($news_database_file)) {
		$news_database_xml = simplexml_load_file($news_database_file);
		
		foreach($news_database_xml->page as $page_entry) {
			if(strval($page_entry->alias) == $page_info->alias) {
				$news_database_xml = removeSimpleXMLnode($news_database_xml, $page_entry);
				$news_database_xml->saveXML($news_database_file);
				break;
			}
		}
		
		if(count($news_database_xml->page) == 0) unlink($news_database_file);
	}
	
?>