Skip to content
Snippets Groups Projects
Commit 76eba96c authored by alangrafu's avatar alangrafu Committed by GIT_AUTHOR_NAME
Browse files

Merge branch 'master' into experimental

parents 4584e09a 0d589a8f
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,11 @@ class Exporter{
array_push($triples, $t);
$t['o'] = LS.'Application';
array_push($triples, $t);
if($conf['parentApp'] != NULL){
$t['p'] = OPMV.'wasDerivedFrom';
$t['o'] = $conf['parentApp'];
array_push($triples, $t);
}
$t['p'] = LS.'usedParameter';
$t['o'] = uniqid("_:b");
......
......@@ -58,7 +58,7 @@ class Importer{
//$arr = explode("lodspeakr/benegesserit", $this->basedir);
//$this->basedir = $arr[0];
$content .= "\$conf['basedir'] = \"$this->basedir\";\n";
$content .= "\$conf['parentApp'] = \"$app\";\n";
$pwd = getcwd();
$content .= "\$conf['home'] = \"$pwd/\";\n";
......@@ -78,7 +78,12 @@ class Importer{
foreach($appParams as $k => $v){
$content .= "\$conf['$k'] = \"$v\";\n";
}
$content .= "/*ATTENTION: By default this application is available to
* be exported and copied (its configuration)
* by others. If you do not want that,
* turn the next option as false
*/
\$conf['export'] = true;\n\n";
//Components
foreach($compArr as $v){
$component = $v['s'];
......
......@@ -63,10 +63,10 @@ QUERY;
$ext = 'html';
$inserts = "";
foreach($conf['http_accept'] as $extension => $f){
$page = $localUri.".".$extension;
$page = $localUri.$conf['extension_connector'].$extension;
foreach($f as $v){
if($contentType == $v){
$returnPage = $localUri.".".$extension;
$returnPage = $localUri.$conf['extension_connector'].$extension;
}
if($inserts != ""){
$inserts .= "UNION ";
......
......@@ -217,7 +217,7 @@ class Utils{
$handle = opendir('.');
while (false !== ($modelFile = readdir($handle))) {
if($modelFile != "." && $modelFile != ".."){
if($modelFile != "." && $modelFile != ".." && strpos($modelFile, ".") !== 0){
if(is_dir($modelFile)){
//Save it for later, after all the queries in the current directory has been resolved
$subDirs[]=$modelFile;
......
......@@ -41,7 +41,9 @@ $conf['root'] = 'special/index';
//Debug
$conf['debug'] = false;
$conf['extension_connector'] = '.';
include_once('settings.inc.php');
$conf['view']['standard']['baseUrl'] = $conf['basedir'];
?>
......@@ -41,7 +41,7 @@ $extension = Utils::getExtension($acceptContentType);
if($acceptContentType == NULL){
Utils::send406($uri);
}
if(file_exists($conf['static']['directory'].$_GET['q']) && sizeof($_GET['q'])>0){
if(sizeof($_GET['q'])>0 && file_exists($conf['static']['directory'].$_GET['q'])){
echo file_get_contents($conf['static']['directory'].$_GET['q']);
exit(0);
}
......
<?php
class Haanga_Extension_Filter_Alert
{
public $is_safe = TRUE;
static function generator($compiler, $args)
{
if (count($args) != 1) {
$compiler->Error("alert filter only needs one parameter");
}
$x = $args[0];
$pre = '<script type="text/javascript">alert("';
$post = '");</script>';
return hexec('html_entity_decode',
hexec('preg_replace', '/$/', $post,
hexec('preg_replace', '/^/', $pre, $x)));
}
}
<?php
class Haanga_Extension_Filter_D3ForceGraph{
public $is_safe = TRUE;
static function main($obj, $varname){
$nodesArr = array();
$n=0;
$first="";
$nodes = "";
$links = "";
$names = explode(",", $varname);
if(count($names)==2){
foreach($obj as $k){
if(!isset($nodesArr[$k->$names[0]->value])){
$nodesArr[$k->$names[0]->value] = $n++;
$nodes .= $first."{\"name\": \"".$k->$names[0]->value."\", \"group\": 1}";
}
if(!isset($nodesArr[$k->$names[1]->value])){
$nodesArr[$k->$names[1]->value] = $n++;
$nodes .= ",\n {\"name\": \"".$k->$names[1]->value."\", \"group\": 1}";
}
$links .= $first."{\"source\": ".$nodesArr[$k->$names[0]->value].", \"target\": ".$nodesArr[$k->$names[1]->value].", \"value\": 10}";
$first = ",\n ";
}
}
$json ='{"nodes":['.$nodes.'],
"links":['.$links.']}';
$pre = '<script type="text/javascript" src="http://lodspeakr.org/extensions/haanga/filters/d3/js/d3.js"></script>
<script type="text/javascript" src="http://lodspeakr.org/extensions/haanga/filters/d3/js/d3.layout.js"></script>
<script type="text/javascript" src="http://lodspeakr.org/extensions/haanga/filters/d3/js/d3.geom.js"></script>
<link href="http://lodspeakr.org/extensions/haanga/filters/d3/css/force.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var url = "http://alvaro.graves.cl";
var data = '.$json.';
</script>';
$post = '<div style="float: left;border-width: 1px; border-style: solid;" id="chart"></div>
<script type="text/javascript" src="http://lodspeakr.org/extensions/haanga/filters/d3/js/force.js">
</script>';
return $pre.$post;
}
}
......@@ -7,6 +7,7 @@ class Haanga_Extension_Filter_Length
{
$count = hexec('count', $args[0]);
$strlen = hexec('strlen', $args[0]);
$props = hexec('count', hexec('array_keys', hexec('get_object_vars', $args[0])));
$guess = hexpr_cond(hexec('is_array', $args[0]), hexec('count', $args[0]),
hexec('strlen', $args[0]));
......@@ -19,7 +20,7 @@ class Haanga_Extension_Filter_Length
} else if (is_string($value)) {
return $strlen;
} else if (is_object($value)) {
return count(array_keys($value));
return $props;
} else {
return $guess;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment