<?php
define("ROOT_DIR",realpath(dirname(__FILE__))."/../");

include(ROOT_DIR."init.inc");
$MISConfig = new MISConfig();
if(!isset($argv[1]) || !file_exists($MISConfig->getConfigFilesPath().$argv[1])) die("Datei ".$MISConfig->getConfigFilesPath().$argv[1]." existiert nicht!");

$projectDOM = new DOMDocument('1.0', 'iso-8859-1');
$projectDOM->load($MISConfig->getConfigFilesPath().$argv[1]);
$projectXpath = new DOMXpath($projectDOM);

$Images = $projectXpath->query("/Configuration/Publishes/Publish/Images/Image");

for($i=0;$i<$Images->length;$i++){
	$Image = $Images->item($i);
	$MISConfig->setNodeValue("Name", utf8_decode($Image->getElementsByTagName("Description")->item(0)->nodeValue), $projectDOM, $Image);
}
$projectDOM->save($MISConfig->getConfigFilesPath().$argv[1]);
?>