Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
	require_once("SimpleXMLExtended.php");

	if (file_exists(dirname(__FILE__)."/../articoli/".$_REQUEST["html"])) {
		$d = new DOMDocument;
		$mock = new DOMDocument;

		$d->loadHTML(file_get_contents(dirname(__FILE__)."/../articoli/".$_REQUEST["html"]));

		$body = $d->getElementsByTagName('body')->item(0);
		foreach ($body->childNodes as $child){
		    $mock->appendChild($mock->importNode($child, true));
		}

		echo $mock->saveHTML();

		if (isset($_REQUEST["popup"])) {
			$xmlRoot;
			if (file_exists(dirname(__FILE__)."/../itinerari/".$_COOKIE["lm-session"].".xml")) {
				$xmlRoot = simplexml_load_file(dirname(__FILE__)."/../itinerari/".$_COOKIE["lm-session"].".xml", 'SimpleXMLExtended');

				$articoloNodo = $xmlRoot->xpath('//articolo[@articoloId="'.$_REQUEST["padreArt"].'"]')[0];
				$articoloPopup = $articoloNodo->addChild("articolopopup");

				$intestazione = $articoloPopup->addChild("intestazione");
				$intestazione->addCData($d->getElementsByTagName('title')->item(0)->textContent);

				$xmlRoot->saveXML(dirname(__FILE__)."/../itinerari/".$_COOKIE["lm-session"].".xml");
			}
		}

	} else {
		header($_SERVER['SERVER_PROTOCOL'] . ' 404 File Not Found', true, 404);
		echo "<b>File Not Found</b>";
	}

?>

Commits for Nextrek/legal-map/ajax/openArticle.php

Diff revisions: vs.
Revision Author Commited Message
787 Diff Diff FSallustio picture FSallustio Tue 29 Sep, 2015 09:14:29 +0000
782 Diff Diff FSallustio picture FSallustio Thu 24 Sep, 2015 16:12:59 +0000
758 Diff Diff FSallustio picture FSallustio Thu 17 Sep, 2015 15:10:13 +0000
757 FSallustio picture FSallustio Thu 17 Sep, 2015 10:52:50 +0000