From: <sk...@us...> - 2008-02-07 19:06:46
|
Revision: 519 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=519&view=rev Author: sknappe Date: 2008-02-07 11:06:40 -0800 (Thu, 07 Feb 2008) Log Message: ----------- now it is possible to look for dbpedia-navigator/resource/Leipzig for example Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax.php trunk/src/dbpedia-navigator/ajaxfunctions.php trunk/src/dbpedia-navigator/index.php Added Paths: ----------- trunk/src/dbpedia-navigator/.htaccess-dist Copied: trunk/src/dbpedia-navigator/.htaccess-dist (from rev 512, trunk/src/dbpedia-navigator/.htaccess) =================================================================== --- trunk/src/dbpedia-navigator/.htaccess-dist (rev 0) +++ trunk/src/dbpedia-navigator/.htaccess-dist 2008-02-07 19:06:40 UTC (rev 519) @@ -0,0 +1,8 @@ +RewriteEngine On +Options +FollowSymlinks +RewriteBase /dbpedia-navigator/ + +# Rule Fuer die Module +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^([^/]+)/([^/]+)$ index.php?$1=$2&path=../ \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax.php =================================================================== --- trunk/src/dbpedia-navigator/ajax.php 2008-02-07 18:52:41 UTC (rev 518) +++ trunk/src/dbpedia-navigator/ajax.php 2008-02-07 19:06:40 UTC (rev 519) @@ -1,8 +1,10 @@ <?php require_once ("xajax/xajax_core/xajax.inc.php"); $sid = session_id(); +if (isset($_GET['path'])) $path=$_GET['path']; +else $path=""; -$xajax = new xajax("ajaxfunctions.php?sid=$sid"); +$xajax = new xajax($path."ajaxfunctions.php?sid=$sid&path=".$path); $xajax->configureMany(array('debug'=>true)); $xajax->register(XAJAX_FUNCTION, 'getsubjects', array( @@ -25,7 +27,6 @@ $xajax->registerFunction('toNegative'); $xajax->registerFunction('clearPositives'); $xajax->registerFunction('clearNegatives'); -$xajax->registerFunction('showInterests'); $xajax->registerFunction('removePosInterest'); $xajax->registerFunction('removeNegInterest'); $xajax->registerFunction('stopServerCall'); Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 18:52:41 UTC (rev 518) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-07 19:06:40 UTC (rev 519) @@ -180,11 +180,11 @@ //add Positives and Negatives to Interests $posInterests=""; if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ - $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"images/remove.png\" alt=\"Delete\"/></a><br/>"; + $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"".$_GET['path']."images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; } $negInterests=""; if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ - $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"images/remove.png\" alt=\"Delete\"/></a><br/>"; + $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"".$_GET['path']."images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; } $objResponse->assign("articlecontent", "innerHTML", $content); @@ -212,8 +212,19 @@ $_SESSION['positive']=$array; } + //add Positives and Negatives to Interests + $posInterests=""; + if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ + $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"".$_GET['path']."images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $negInterests=""; + if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ + $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"".$_GET['path']."images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $objResponse = new xajaxResponse(); - $objResponse->call('xajax_showInterests'); + $objResponse->assign('Positives','innerHTML',$posInterests); + $objResponse->assign('Negatives','innerHTML',$negInterests); return $objResponse; } @@ -233,8 +244,19 @@ $_SESSION['negative']=$array; } + //add Positives and Negatives to Interests + $posInterests=""; + if (isset($_SESSION['positive'])) foreach($_SESSION['positive'] as $pos){ + $posInterests.=urldecode(substr (strrchr ($pos, "/"), 1))." <a href=\"\" onclick=\"xajax_toNegative('".$pos."');return false;\"><img src=\"".$_GET['path']."images/minus.jpg\" alt=\"Minus\"/></a> <a href=\"\" onclick=\"xajax_removePosInterest('".$pos."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $negInterests=""; + if (isset($_SESSION['negative'])) foreach($_SESSION['negative'] as $neg){ + $negInterests.=urldecode(substr (strrchr ($neg, "/"), 1))." <a href=\"\" onclick=\"xajax_toPositive('".$neg."');return false;\"><img src=\"".$_GET['path']."images/plus.jpg\" alt=\"Plus\"/></a> <a href=\"\" onclick=\"xajax_removeNegInterest('".$neg."');return false;\"><img src=\"".$_GET['path']."images/remove.png\" alt=\"Delete\"/></a><br/>"; + } + $objResponse = new xajaxResponse(); - $objResponse->call('xajax_showInterests'); + $objResponse->assign('Positives','innerHTML',$posInterests); + $objResponse->assign('Negatives','innerHTML',$negInterests); return $objResponse; } @@ -377,6 +399,7 @@ function setRunning($id,$running) { + if(!is_dir("temp")) mkdir("temp"); $file=fopen("./temp/".$id.".temp","w"); fwrite($file, $running); fclose($file); Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-07 18:52:41 UTC (rev 518) +++ trunk/src/dbpedia-navigator/index.php 2008-02-07 19:06:40 UTC (rev 519) @@ -10,6 +10,9 @@ $ids=$sc->getIDs(); $_SESSION['id']=$ids[0]; $_SESSION['ksID']=$ids[1]; + +if (isset($_GET['path'])) $path=$_GET['path']; +else $path=""; // debugging code // echo '<pre>'; @@ -28,8 +31,8 @@ <head> <title>DBpedia Navigator</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> - <link rel="stylesheet" href="default.css"/> - <?php $xajax->printJavascript('xajax/'); ?> + <link rel="stylesheet" href="<?php print $path;?>default.css"/> + <?php $xajax->printJavascript($path.'xajax/'); ?> <script type="text/javascript"> showLoading = function() { xajax.$('Loading').style.display='inline'; @@ -39,10 +42,10 @@ }; </script> </head> - <body <?php if (isset($_GET['resource'])) print "onLoad=\"xajax_getarticle('".$_GET['resource']."',-1);return false;\">";unset($_GET['resource']);?>> + <body <?php if (isset($_GET['resource'])) print "onLoad=\"xajax_getarticle('".$_GET['resource']."',-1);return false;\"";unset($_GET['resource']);?>> <!-- <h1>DBpedia Navigator</h1> --> -<div><table border="0" width="100%"><tr><td width="35%"><img src="images/dbpedia_navigator.png" alt="DBpedia Navigator" style="padding:5px" /></td><td width="50%"><span id="conceptlink"></span></td><td width="15%"><span id="Loading" style="display:none">Server Call... <img src="images/remove.png" onclick="xajax_stopServerCall();return false;" /></span></td></tr></table></div> +<div><table border="0" width="100%"><tr><td width="35%"><img src="<?php print $path;?>images/dbpedia_navigator.png" alt="DBpedia Navigator" style="padding:5px" /></td><td width="50%"><span id="conceptlink"></span></td><td width="15%"><span id="Loading" style="display:none">Server Call... <img src="<?php print $path;?>images/remove.png" onclick="xajax_stopServerCall();return false;" /></span></td></tr></table></div> <div id="layer" style="display:none"> <div id="layerContent" style="display:none"></div> </div> @@ -77,8 +80,8 @@ ... and implemented by <a href="http://jens-lehmann.org">Jens Lehmann</a> and Sebastian Knappe at the <a href="http:/aksw.org">AKSW</a> research group (University of Leipzig).</p> - <a href="http://www.w3.org/2004/OWL/"><img src="images/sw-owl-green.png" alt="OWL logo" /></a> - <a href="http://www.w3.org/2001/sw/DataAccess/"><img src="images/sw-sparql-green.png" alt="SPARQL logo"/></a> + <a href="http://www.w3.org/2004/OWL/"><img src="<?php print $path;?>images/sw-owl-green.png" alt="OWL logo" /></a> + <a href="http://www.w3.org/2001/sw/DataAccess/"><img src="<?php print $path;?>images/sw-sparql-green.png" alt="SPARQL logo"/></a> </div> <input type="button" value="Learn" class="button" onclick="xajax_learnConcept();return false;" /> @@ -132,12 +135,12 @@ $uri = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; echo '<div><a href="http://validator.w3.org/check?uri='.$uri.'"'; - echo '><img src="images/valid-xhtml10.png" alt="valid XHTML 1.0" /></a>'."\n"; + echo '><img src="'.$path.'images/valid-xhtml10.png" alt="valid XHTML 1.0" /></a>'."\n"; echo '<a href="http://jigsaw.w3.org/css-validator/validator?uri='.$uri.'"'; - echo '><img src="images/valid-css.png" alt="valid CSS" /></a></div>'."\n"; + echo '><img src="'.$path.'images/valid-css.png" alt="valid CSS" /></a></div>'."\n"; ?> </div> - <p><a href='rebuild.php'>rebuild [restart session and redownload WSDL file (for debugging)]</a></p> + <p><a href='<?php print $path;?>rebuild.php'>rebuild [restart session and redownload WSDL file (for debugging)]</a></p> </div> <div id="todo"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |