} elseif ($element == 'instance') { $iid = '1'; } } $s3ql['from'] = $element; $s3ql['where']['project_id'] = $project_id; $D[$element] = S3QLaction($s3ql); #$D[$element]= listS3DB(array('user_id'=>$user_id,'db'=>$db,'table'=>$element, 'cols'=>$cols, 'project_id'=>"~ '^".$project_id."$'",'permission'=>"~ '(^|_)".$project_id."_'", 'iid'=>$iid)); #echo '<pre>';print_r($D[$element]); if (is_array($D[$element])) { if ($element == 'statements') { $D[$element] = array_map('grab_class_instance_id', $D[$element]); $D[$element] = array_filter(array_map('delete_empty_statements', $D[$element])); #must ignore statements with no value } elseif ($element == 'rules') { $D[$element] = include_class_id($D[$element], $db); #whenever the element is a rule, replace the subject with a class $D[$element] = include_object_class_id($D[$element], $project_id, $db); } elseif ($element == 'instances') { $D[$element] = include_instance_class_id($D[$element], $project_id, $db); } #whenever the element is a rule, replace the subject with a class } #$D[$element] = array_map('ValuesToFileURLs',$D[$element]); if (is_array($D[$element])) { foreach ($D[$element] as $n3statement) { $prefixRef = array_keys($s3Elements[$element]); #first line, the resource we are making a statement on #$n3 .= '<'.$url.strtoupper(substr($element,0,1)).urlencode('#').$n3statement[$s3idNames[$element]].'>'.chr(10); $n3 .= $n3statement[$s3idNames[$element]] . ' a rdfs:Class ;' . chr(10); #echo '<pre>';print_r($n3statement);
$s3ql['where']['subject_id'] = $class_id; $s3ql['where']['object'] = "!=UID"; #$s3ql['where']['object'] = "[^(UID)]"; } if ($_REQUEST['orderBy'] != '') { $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction']; } #echo '<pre>';print_r($s3ql);exit; $rules = S3QLaction($s3ql); #echo '<pre>';print_r($rules); exit; if (is_array($rules) && !empty($rules)) { #Set the cols to show up in the html table $columns = array('Rule_id', 'Owner', 'CreatedOn', 'SubjectAndId', 'VerbAndId', 'ObjectAndId', 'Validation', 'Notes', 'Actions'); #replace all created_by with login_id $rules = replace_created_by($rules, $db); $rules = include_class_id($rules, $db); $elements = $rules; $rules = grab_acl(compact('user_id', 'elements', 'db')); if ($_REQUEST['action'] == 'edit') { $new = 0; } else { $new = 1; } $data_grid = render_elements($rules, $acl, $columns, 'rule', $new, 'R' . $_REQUEST['rule_id']); #show the table header $num_per_page = $_REQUEST['num_per_page']; $select[$num_per_page] = 'selected'; $perPage = array('10', '50', '100', '150', '200', '250', '300', '350', '400', '450', '500'); echo '<table class="middle" width="100%" align="center"></a> <tr><td> <table class="insidecontents" width="100%" align="center">