forked from wadoli/HaloACL
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch_for_SMW1.8.0.5.txt
94 lines (90 loc) · 3.65 KB
/
patch_for_SMW1.8.0.5.txt
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
--- includes/SMW_ParserExtensions.php 2014-10-16 18:45:32.306625670 +0200
+++ includes/SMW_ParserExtensions.php 2014-10-16 18:44:57.474452944 +0200
@@ -168,6 +168,9 @@
}
$result = $dv->getShortWikitext( true );
+/*op-patch|TS|2010-07-13|HaloACL|Semantic protection|start|doc|http://dmwiki.ontoprise.com:8888/dmwiki/index.php/Semantic_protection*/
+ wfRunHooks('PropertyBeforeOutput', array(&$dv, &$result));
+/*op-patch|TS|2010-07-13|end*/
if ( ( $smwgInlineErrors && $smwgStoreAnnotations && SMWParserExtensions::$mTempStoreAnnotations ) && ( !$dv->isValid() ) ) {
$result .= $dv->getErrorText();
--- includes/storage/SMW_QueryResult.php 2014-10-16 18:45:32.294625611 +0200
+++ includes/storage/SMW_QueryResult.php 2014-10-16 18:44:57.442452786 +0200
@@ -87,6 +87,39 @@
$this->mStore = $store;
}
+ /*op-patch|TS|2009-06-19|HaloACL|Semantic protection|start|doc|http://dmwiki.ontoprise.com:8888/dmwiki/index.php/Semantic_protection*/
+ /**
+ * Creates a new query result based on $this query result. Everything
+ * but the content of $this query result is copied into the new one.
+ * This is useful for query result filters which copy the content only partly.
+ *
+ * @param SMWQueryResult $this
+ * The following parts of this query result are copied into the new q.r.:
+ * - print requests
+ * - query, querystring
+ * - furtherres
+ * - extra printouts
+ * @param array
+ * An array of results e.g. the set of filtered results of the original query.
+ * If the new q.r. should have no results then pass an empty array.
+ *
+ * @return SMWQueryResult
+ * A partly copied $queryResult
+ */
+ public function newFromQueryResult($results) {
+ $classname = get_class($this);
+
+ $qr = new $classname($this->mPrintRequests,
+ $this->mQuery,
+ $results,
+ $this->mStore,
+ $this->mFurtherResults);
+
+ return $qr;
+ }
+ /*op-patch|TS|2009-06-19|end*/
+
+
/**
* Get the SMWStore object that this result is based on.
*
--- includes/storage/SMW_ResultArray.php 2014-10-16 18:45:32.294625611 +0200
+++ includes/storage/SMW_ResultArray.php 2014-10-16 18:44:57.454452841 +0200
@@ -56,7 +56,7 @@
* @return SMWStore
*/
public function getStore() {
- return $this->mStore;
+ $this->mStore = smwfGetStore();
}
/**
--- includes/storage/SQLStore/SMW_SQLStore3_Queries.php 2014-10-16 18:45:32.294625611 +0200
+++ includes/storage/SQLStore/SMW_SQLStore3_Queries.php 2014-10-16 18:44:57.410452618 +0200
@@ -592,7 +592,25 @@
// No defaultnamespaces here; If any, these are already in the concept.
// Unescaping is the same as in SMW_DV_Conept's getWikiValue().
$desc = $qp->getQueryDescription( str_replace( array( '<', '>', '&' ), array( '<', '>', '&' ), $row->concept_txt ) );
- $qid = $this->compileQueries( $desc );
+/*op-patch|TS|2010-07-14|HaloACL|Semantic protection|start*/
+ global $haclgProtectProperties;
+ if (isset($haclgProtectProperties) && $haclgProtectProperties) {
+ $query = new SMWQuery($desc);
+ wfRunHooks('RewriteQuery', array(&$query, &$queryEmpty) );
+ $errors = $query->getErrors();
+ if (!empty($errors)) {
+ $this->m_errors += $errors;
+ }
+ if ($queryEmpty) {
+ $qid = -1;
+ } else {
+ $desc = $query->getDescription();
+ $qid = $this->compileQueries( $desc );
+ }
+ } else {
+ $qid = $this->compileQueries( $desc );
+ }
+/*op-patch|TS|2010-07-14|end*/
if ($qid != -1) {
$query = $this->m_queries[$qid];
} else { // somehow the concept query is no longer valid; maybe some syntax changed (upgrade) or global settings were modified since storing it