r112973 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112972‎ | r112973 | r112974 >
Date:10:53, 4 March 2012
Author:foxtrott
Status:deferred
Tags:
Comment:
stylize
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Filtered/SRF_Filtered.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Filtered/SRF_Filtered_Item.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Filtered/filters/SRF_FF_Value.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Filtered/filters/SRF_Filtered_Filter.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Filtered/views/SRF_FV_List.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Filtered/views/SRF_Filtered_View.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Filtered/filters/SRF_Filtered_Filter.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SRF_Filtered_Filter class
6 - *
 6+ *
77 * @author Stephan Gambke
88 * @file
99 * @ingroup SemanticResultFormats
@@ -14,45 +14,45 @@
1515 * @ingroup SemanticResultFormats
1616 */
1717 abstract class SRF_Filtered_Filter {
18 -
 18+
1919 private $mResults = null;
2020 private $mPrintRequest = null;
2121 private $mQueryPrinter = null;
22 -
 22+
2323 public function __construct( &$results, SMWPrintRequest $printRequest, SRFFiltered &$queryPrinter ) {
2424 $this->mResults = $results;
2525 $this->mPrintRequest = $printRequest;
2626 $this->mQueryPrinter = $queryPrinter;
2727 }
2828
29 - public function &getQueryResults() {return $this->mResults;}
30 - public function &getPrintRequest() {return $this->mPrintRequest;}
31 - public function &getQueryPrinter() {return $this->mQueryPrinter;}
32 -
33 -
 29+ public function &getQueryResults() { return $this->mResults; }
 30+ public function &getPrintRequest() { return $this->mPrintRequest; }
 31+ public function &getQueryPrinter() { return $this->mQueryPrinter; }
 32+
 33+
3434 public function getActualParameters() {
35 -
 35+
3636 return $this->mPrintRequest->getParameters();
37 -
 37+
3838 }
39 -
 39+
4040 /**
4141 * Returns the name (string) or names (array of strings) of the resource
4242 * modules to load.
43 - *
 43+ *
4444 * @return string|array
4545 */
4646 public function getResourceModules() {
4747 return null;
4848 }
49 -
 49+
5050 /**
5151 * Returns the HTML text that is to be included for this filter.
52 - *
 52+ *
5353 * This text will appear on the page in a div that has the filter's id set
5454 * as class.
55 - *
56 - * @return string
 55+ *
 56+ * @return string
5757 */
5858 public function getResultText() {
5959 return '';
@@ -60,7 +60,7 @@
6161
6262 /**
6363 * Returns an array of config data for this filter to be stored in the JS
64 - * @return null
 64+ * @return null
6565 */
6666 public function getJsData() {
6767 return null;
Index: trunk/extensions/SemanticResultFormats/Filtered/filters/SRF_FF_Value.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SRF_FF_Value class
6 - *
 6+ *
77 * @author Stephan Gambke
88 * @file
99 * @ingroup SemanticResultFormats
@@ -13,18 +13,18 @@
1414 *
1515 * Available parameters for this filter:
1616 * value filter switches: switches to be shown for this filter; currently only 'and or' supported
17 - *
 17+ *
1818 * @ingroup SemanticResultFormats
1919 */
2020 class SRF_FF_Value extends SRF_Filtered_Filter {
21 -
 21+
2222 /**
2323 * Returns the HTML text that is to be included for this view.
24 - *
 24+ *
2525 * This text will appear on the page in a div that has the view's id set as
2626 * class.
27 - *
28 - * @return string
 27+ *
 28+ * @return string
2929 */
3030 public function getResultText() {
3131 return '';
@@ -33,28 +33,28 @@
3434 /**
3535 * Returns the name (string) or names (array of strings) of the resource
3636 * modules to load.
37 - *
 37+ *
3838 * @return string|array
3939 */
4040 public function getResourceModules() {
4141 return 'ext.srf.filtered.value-filter';
4242 }
43 -
 43+
4444 /**
4545 * Returns an array of config data for this filter to be stored in the JS
46 - * @return null
 46+ * @return null
4747 */
4848 public function getJsData() {
4949 $params = $this->getActualParameters();
5050
5151 if ( array_key_exists( 'value filter switches', $params ) ) {
52 - $switches = explode(',', $params['value filter switches'] );
53 - $switches = array_map('trim', $switches );
54 -
 52+ $switches = explode( ',', $params['value filter switches'] );
 53+ $switches = array_map( 'trim', $switches );
 54+
5555 return array( 'switches' => $switches );
5656 }
57 -
 57+
5858 return null;
5959 }
60 -
 60+
6161 }
Index: trunk/extensions/SemanticResultFormats/Filtered/SRF_Filtered_Item.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SRF_Filtered_Item class
6 - *
 6+ *
77 * @author Stephan Gambke
88 * @file
99 * @ingroup SemanticResultFormats
@@ -14,60 +14,60 @@
1515 * @ingroup SemanticResultFormats
1616 */
1717 class SRF_Filtered_Item {
18 -
 18+
1919 private $mResultArray;
2020 private $mItemData = array();
2121 private $mQueryPrinter;
22 -
23 - public function __construct($resultArray, SRFFiltered &$queryPrinter) {
 22+
 23+ public function __construct( $resultArray, SRFFiltered &$queryPrinter ) {
2424 $this->mResultArray = $resultArray;
2525 $this->mQueryPrinter = $queryPrinter;
2626 }
27 -
28 - public function setDataForView ( $viewId, &$data ){
 27+
 28+ public function setDataForView ( $viewId, &$data ) {
2929 $this->mItemData[$viewId] = $data;
3030 }
31 -
32 - public function unsetDataForView ( $viewId ){
33 - unset($this->mItemData[$viewId]);
 31+
 32+ public function unsetDataForView ( $viewId ) {
 33+ unset( $this->mItemData[$viewId] );
3434 }
35 -
36 - public function getDataForView ( $viewId ){
 35+
 36+ public function getDataForView ( $viewId ) {
3737 return $this->mItemData[$viewId];
3838 }
39 -
 39+
4040 public function getValue() {
4141 return $this->mResultArray;
4242 }
43 -
 43+
4444 public function getArrayRepresentation() {
45 -
 45+
4646 $printouts = array();
47 -
 47+
4848 foreach ( $this->mResultArray as $i => $field ) {
49 -
 49+
5050 $printRequest = $field->getPrintRequest();
5151
5252 $label = $printRequest->getLabel();
5353 $type = $printRequest->getTypeID();
5454 $params = $printRequest->getParameters();
55 -
 55+
5656 $values = array();
57 -
 57+
5858 $field->reset();
5959 while ( ( $value = $field->getNextText( SMW_OUTPUT_WIKI, null ) ) !== false ) {
6060 $values[] = $value;
6161 }
62 -
63 - $printouts[ md5($printRequest->getHash()) ] = array(
 62+
 63+ $printouts[ md5( $printRequest->getHash() ) ] = array(
6464 'label' => $label,
6565 'type' => $type,
6666 'params' => $params,
6767 'values' => $values,
6868 );
6969 }
70 -
71 -
 70+
 71+
7272 return array(
7373 'printouts' => $printouts,
7474 'data' => $this->mItemData,
Index: trunk/extensions/SemanticResultFormats/Filtered/views/SRF_FV_List.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SRF_FV_List class
6 - *
 6+ *
77 * @author Stephan Gambke
88 * @file
99 * @ingroup SemanticResultFormats
@@ -17,44 +17,44 @@
1818 * list view introtemplate: a template prepended to the list
1919 * list view outrotemplate: a template appended to the list
2020 * list view named args: use named args for templates
21 - *
 21+ *
2222 * @ingroup SemanticResultFormats
2323 */
2424 class SRF_FV_List extends SRF_Filtered_View {
25 -
 25+
2626 private $mFormat, $mTemplate, $mIntroTemplate, $mOutroTemplate, $mNamedArgs, $mShowHeaders;
27 -
 27+
2828 /**
2929 * Transfers the parameters applicable to this view into internal variables.
3030 */
3131 protected function handleParameters() {
32 -
 32+
3333 $params = $this->getActualParameters();
34 -
 34+
3535 $this->mFormat = $params['list view type'];
3636 $this->mTemplate = $params['list view template'];
3737 $this->mIntroTemplate = $params['list view introtemplate'];
3838 $this->mOutroTemplate = $params['list view outrotemplate'];
3939 $this->mNamedArgs = $params['list view named args'];
40 -
 40+
4141 if ( $params['headers'] == 'hide' ) {
4242 $this->mShowHeaders = SMW_HEADERS_HIDE;
4343 } elseif ( $params['headers'] == 'plain' ) {
4444 $this->mShowHeaders = SMW_HEADERS_PLAIN;
4545 } else {
4646 $this->mShowHeaders = SMW_HEADERS_SHOW;
47 - }
 47+ }
4848 }
4949
5050 /**
5151 * Returns the wiki text that is to be included for this view.
52 - *
53 - * @return string
 52+ *
 53+ * @return string
5454 */
5555 public function getResultText() {
56 -
 56+
5757 $this->handleParameters();
58 -
 58+
5959 // Determine mark-up strings used around list items:
6060 if ( ( $this->mFormat == 'ul' ) || ( $this->mFormat == 'ol' ) ) {
6161 $header = "<" . $this->mFormat . ">\n";
@@ -69,13 +69,13 @@
7070 $rowend = "</div>\n";
7171 $listsep = ', ';
7272 }
73 -
 73+
7474 // Initialise more values
7575 $result = '';
7676
7777 if ( $header !== '' ) {
7878 $result .= $header;
79 - }
 79+ }
8080
8181 if ( $this->mIntroTemplate !== '' ) {
8282 $result .= "{{" . $this->mIntroTemplate . "}}";
@@ -83,32 +83,32 @@
8484
8585 // Now print each row
8686 $rownum = -1;
87 -
88 - foreach ($this->getQueryResults() as $id => $value) {
 87+
 88+ foreach ( $this->getQueryResults() as $id => $value ) {
8989 $row = $value->getValue();
90 -
 90+
9191 $this->printRow( $row, $rownum, $rowstart . $id . "' id='$id' >", $rowend, $result, $listsep );
9292 }
93 -
 93+
9494 if ( $this->mOutroTemplate !== '' ) {
9595 $result .= "{{" . $this->mOutroTemplate . "}}";
9696 }
97 -
 97+
9898 // Print footer
9999 if ( $footer !== '' ) {
100100 $result .= $footer;
101101 }
102 -
 102+
103103 return $result;
104104 }
105 -
 105+
106106 /**
107107 * Prints one row of a list view.
108108 */
109109 protected function printRow( $row, &$rownum, $rowstart, $rowend, &$result, $listsep ) {
110110
111111 $rownum++;
112 -
 112+
113113 $result .= $rowstart;
114114
115115 if ( $this->mTemplate !== '' ) { // build template code
@@ -116,28 +116,28 @@
117117
118118 // $wikitext = ( $this->mUserParam ) ? "|userparam=$this->mUserParam" : '';
119119 $wikitext = '';
120 -
 120+
121121 foreach ( $row as $i => $field ) {
122122 $wikitext .= '|' . ( $this->mNamedArgs ? '?' . $field->getPrintRequest()->getLabel() : $i + 1 ) . '=';
123123 $first_value = true;
124 -
 124+
125125 $field->reset();
126126 while ( ( $text = $field->getNextText( SMW_OUTPUT_WIKI, $this->getQueryPrinter()->getLinker( $i == 0 ) ) ) !== false ) {
127127 if ( $first_value ) $first_value = false; else $wikitext .= ', ';
128128 $wikitext .= $text;
129129 }
130130 }
131 -
 131+
132132 $wikitext .= "|#=$rownum";
133133 $result .= '{{' . $this->mTemplate . $wikitext . '}}';
134134
135135 } else { // build simple list
136136 $first_col = true;
137137 $found_values = false; // has anything but the first column been printed?
138 -
 138+
139139 foreach ( $row as $field ) {
140140 $first_value = true;
141 -
 141+
142142 while ( ( $text = $field->getNextText( SMW_OUTPUT_WIKI, $this->getQueryPrinter()->getLinker( $first_col ) ) ) !== false ) {
143143 if ( !$first_col && !$found_values ) { // first values after first column
144144 $result .= ' (';
@@ -146,64 +146,64 @@
147147 // any value after '(' or non-first values on first column
148148 $result .= "$listsep ";
149149 }
150 -
 150+
151151 if ( $first_value ) { // first value in any column, print header
152152 $first_value = false;
153 -
 153+
154154 if ( ( $this->mShowHeaders != SMW_HEADERS_HIDE ) && ( $field->getPrintRequest()->getLabel() !== '' ) ) {
155 - $result .= $field->getPrintRequest()->getText( SMW_OUTPUT_WIKI, ( $this->mShowHeaders == SMW_HEADERS_PLAIN ? null:$this->getQueryPrinter()->getLinker(true, true) ) ) . ' ';
 155+ $result .= $field->getPrintRequest()->getText( SMW_OUTPUT_WIKI, ( $this->mShowHeaders == SMW_HEADERS_PLAIN ? null:$this->getQueryPrinter()->getLinker( true, true ) ) ) . ' ';
156156 }
157157 }
158 -
 158+
159159 $result .= $text; // actual output value
160160 }
161 -
 161+
162162 $first_col = false;
163163 }
164 -
 164+
165165 if ( $found_values ) $result .= ')';
166166 }
167 -
 167+
168168 $result .= $rowend;
169169 }
170 -
 170+
171171 /**
172172 * A function to describe the allowed parameters of a query for this view.
173 - *
 173+ *
174174 * @return array of Parameter
175175 */
176176 public static function getParameters() {
177177 $params = parent::getParameters();
178 -
 178+
179179 $params['list view type'] = new Parameter( 'list type' );
180180 $params['list view type']->setMessage( 'srf-paramdesc-filtered-list-type' );
181 - $params['list view type']->setDefault( 'list' );
182 -
 181+ $params['list view type']->setDefault( 'list' );
 182+
183183 $params['list view template'] = new Parameter( 'list template' );
184184 $params['list view template']->setMessage( 'srf-paramdesc-filtered-list-template' );
185 - $params['list view template']->setDefault( '' );
186 -
 185+ $params['list view template']->setDefault( '' );
 186+
187187 $params['list view named args'] = new Parameter( 'list named args', Parameter::TYPE_BOOLEAN, false );
188188 $params['list view named args']->setMessage( 'srf-paramdesc-filtered-list-named-args' );
189 -
 189+
190190 $params['list view introtemplate'] = new Parameter( 'list introtemplate' );
191 - $params['list view introtemplate']->setMessage( 'srf-paramdesc-filtered-list-introtemplate' );
 191+ $params['list view introtemplate']->setMessage( 'srf-paramdesc-filtered-list-introtemplate' );
192192 $params['list view introtemplate']->setDefault( '' );
193 -
 193+
194194 $params['list view outrotemplate'] = new Parameter( 'list outrotemplate' );
195 - $params['list view outrotemplate']->setMessage( 'srf-paramdesc-filtered-list-outrotemplate' );
 195+ $params['list view outrotemplate']->setMessage( 'srf-paramdesc-filtered-list-outrotemplate' );
196196 $params['list view outrotemplate']->setDefault( '' );
197 -
 197+
198198 return $params;
199199 }
200200
201201 /**
202202 * Returns the name of the resource module to load for this view.
203 - *
 203+ *
204204 * @return string|array
205205 */
206206 public function getResourceModules() {
207207 return 'ext.srf.filtered.list-view';
208208 }
209 -
 209+
210210 }
Index: trunk/extensions/SemanticResultFormats/Filtered/views/SRF_Filtered_View.php
@@ -2,7 +2,7 @@
33
44 /**
55 * File holding the SRF_Filtered_View class
6 - *
 6+ *
77 * @author Stephan Gambke
88 * @file
99 * @ingroup SemanticResultFormats
@@ -14,15 +14,15 @@
1515 * @ingroup SemanticResultFormats
1616 */
1717 abstract class SRF_Filtered_View {
18 -
 18+
1919 private $mId;
2020 private $mResults;
2121 private $mParameters;
2222 private $mQueryPrinter;
23 -
 23+
2424 /**
2525 * Constructor for the view.
26 - *
 26+ *
2727 * @param $id the view id
2828 * @param $results array of SRF_Filtered_Item containing the query results
2929 * @param type $params array of parameter values given as key-value-pairs
@@ -33,25 +33,25 @@
3434 $this->mParameters = $params;
3535 $this->mQueryPrinter = $queryPrinter;
3636 }
37 -
38 - public function getId() {return $this->mId;}
39 - public function &getQueryResults() {return $this->mResults;}
40 - public function &getActualParameters() {return $this->mParameters;}
41 - public function &getQueryPrinter() {return $this->mQueryPrinter;}
42 -
 37+
 38+ public function getId() { return $this->mId; }
 39+ public function &getQueryResults() { return $this->mResults; }
 40+ public function &getActualParameters() { return $this->mParameters; }
 41+ public function &getQueryPrinter() { return $this->mQueryPrinter; }
 42+
4343 /**
4444 * Returns the name (string) or names (array of strings) of the resource
4545 * modules to load.
46 - *
 46+ *
4747 * @return string|array
4848 */
4949 public function getResourceModules() {
5050 return null;
5151 }
52 -
 52+
5353 /**
5454 * A function to describe the allowed parameters of a query for this view.
55 - *
 55+ *
5656 * @return array of Parameter
5757 */
5858 public static function getParameters() {
@@ -60,11 +60,11 @@
6161
6262 /**
6363 * Returns the HTML text that is to be included for this view.
64 - *
 64+ *
6565 * This text will appear on the page in a div that has the view's id set as
6666 * class.
67 - *
68 - * @return string
 67+ *
 68+ * @return string
6969 */
7070 public function getResultText() {
7171 return '';
Index: trunk/extensions/SemanticResultFormats/Filtered/SRF_Filtered.php
@@ -2,11 +2,11 @@
33
44 /**
55 * File holding the SRFFiltered class.
6 - *
 6+ *
77 * @file
88 * @ingroup SemanticResultFormats
99 * @author Stephan Gambke
10 - *
 10+ *
1111 */
1212
1313 $formatDir = dirname( __FILE__ ) . '/';
@@ -23,56 +23,56 @@
2424 /**
2525 * Result printer that displays results in switchable views and offers
2626 * client-side (JavaScript based) filtering.
27 - *
 27+ *
2828 * This result printer is ultimately planned to replace exhibit. Currently only
2929 * a list view is available. It is not yet possible to switch between views.
3030 * There is also only the 'value' filter available yet.
31 - *
 31+ *
3232 * Syntax of the #ask call:
3333 * (This is only a syntax example. For currently available features see the
3434 * documentation of the various classes.)
35 - *
 35+ *
3636 * {{#ask:[[SomeCondition]]
3737 * |? SomePrintout |+filter=value, someFutureFilter |+value filter switches=and or, disable, all, none |+someFutureFilter filter option=someOptionValue
3838 * |? SomeOtherPrintout |+filter=value, someOtherFutureFilter |+someOtherFutureFilter filter option=someOptionValue
39 - *
 39+ *
4040 * |format=filtered
4141 * |views=list, someFutureView, someOtherFutureView
42 - *
 42+ *
4343 * |list view type=list
4444 * |list view template=ListItem
45 - *
 45+ *
4646 * |someFutureView view option=someOptionValue
47 - *
 47+ *
4848 * |someOtherFutureView view option=someOptionValue
49 - *
 49+ *
5050 * }}
51 - *
 51+ *
5252 * All format specific parameters are optional, although leaving the 'views'
5353 * parameter empty probably does not make much sense.
54 - *
 54+ *
5555 */
5656 class SRFFiltered extends SMWResultPrinter {
57 -
 57+
5858 /**
5959 * The available view types
60 - * @var array of Strings
 60+ * @var array of Strings
6161 */
6262 private $mViewTypes = array(
6363 'list' => 'SRF_FV_List',
6464 );
65 -
 65+
6666 /**
6767 * The available filter types
68 - * @var array of Strings
 68+ * @var array of Strings
6969 */
7070 private $mFilterTypes = array(
7171 'value' => 'SRF_FF_Value',
7272 );
73 -
 73+
7474 private $mViews;
7575 private $mParams;
76 -
 76+
7777 public function hasTemplates ( $hasTemplates = null ) {
7878 $ret = $this->hasTemplates;
7979 if ( is_bool( $hasTemplates ) ) {
@@ -84,7 +84,7 @@
8585 protected function handleParameters( array $params, $outputmode ) {
8686 parent::handleParameters( $params, $outputmode );
8787
88 - //// Set in SMWResultPrinter:
 88+ // // Set in SMWResultPrinter:
8989 // $this->mIntro = $params['intro'];
9090 // $this->mOutro = $params['outro'];
9191 // $this->mSearchlabel = $params['searchlabel'] === false ? null : $params['searchlabel'];
@@ -94,42 +94,42 @@
9595 // $this->mShowHeaders = SMW_HEADERS_HIDE | SMW_HEADERS_PLAIN | SMW_HEADERS_SHOW;
9696
9797 $this->mSearchlabel = null;
98 -
 98+
9999 $this->mParams = $params;
100100 $this->mViews = array_map( 'trim', explode( ',', $params['views'] ) );
101 -
 101+
102102 }
103103
104104 /**
105105 * Return serialised results in specified format.
106106 */
107107 protected function getResultText( SMWQueryResult $res, $outputmode ) {
108 -
 108+
109109 // collect the query results in an array
110110 $result = array();
111111 while ( $row = $res->getNext() ) {
112112 $result[uniqid()] = new SRF_Filtered_Item( $row, $this );
113113 }
114 -
 114+
115115 $resourceModules = array();
116 -
 116+
117117 // prepare filter data for inclusion in HTML and JS
118118 $filterHtml = '';
119119 $filterHandlers = array();
120120 $filterData = array();
121 -
 121+
122122 foreach ( $res->getPrintRequests() as $printRequest ) {
123123 $filter = $printRequest->getParameter( 'filter' );
124124 if ( $filter ) {
125125
126126 $filtersForPrintout = explode( ',', $filter );
127 - $filtersForPrintout = array_map('trim', $filtersForPrintout);
128 -
 127+ $filtersForPrintout = array_map( 'trim', $filtersForPrintout );
 128+
129129 foreach ( $filtersForPrintout as $filterName ) {
130130 if ( array_key_exists( $filterName, $this->mFilterTypes ) ) {
131 -
132 - $filter = new $this->mFilterTypes[$filterName]( $result, $printRequest, $this);
133 -
 131+
 132+ $filter = new $this->mFilterTypes[$filterName]( $result, $printRequest, $this );
 133+
134134 $resourceModules = $filter->getResourceModules();
135135
136136 if ( is_array( $resourceModules ) ) {
@@ -137,18 +137,18 @@
138138 } elseif ( is_string( $resourceModules ) ) {
139139 SMWOutputs::requireResource( $resourceModules );
140140 }
141 -
 141+
142142 $printRequestHash = md5( $printRequest->getHash() );
143 - $filterHtml .= Html::rawElement( 'div', array('class' => "filtered-$filterName $printRequestHash"), $filter->getResultText() );
144 -
 143+ $filterHtml .= Html::rawElement( 'div', array( 'class' => "filtered-$filterName $printRequestHash" ), $filter->getResultText() );
 144+
145145 $filterHandlers[$filterName] = null;
146146 $filterData[$filterName][$printRequestHash] = $filter->getJsData();
147 -
 147+
148148 }
149149 }
150150 }
151151 }
152 -
 152+
153153 // wrap filters in a div
154154 $filterHtml = Html::rawElement( 'div', array( 'class' => 'filtered-filters' ), $filterHtml );
155155
@@ -156,33 +156,33 @@
157157 $viewHtml = '';
158158 $viewHandlers = array();
159159 $viewElements = array();
160 -
 160+
161161 foreach ( $this->mViews as $viewName ) {
162162 if ( array_key_exists( $viewName, $this->mViewTypes ) ) {
163 -
 163+
164164 // generate unique id
165165 $viewid = uniqid();
166166
167167 $view = new $this->mViewTypes[$viewName]( $viewid, $result, $this->mParams, $this );
168 -
 168+
169169 $resourceModules = $view->getResourceModules();
170 -
 170+
171171 if ( is_array( $resourceModules ) ) {
172172 array_walk( $resourceModules, 'SMWOutputs::requireResource' );
173173 } elseif ( is_string( $resourceModules ) ) {
174174 SMWOutputs::requireResource( $resourceModules );
175175 }
176 -
177 - $viewHtml .= Html::rawElement( 'div', array('class' => "filtered-$viewName $viewid"), $view->getResultText() );
178 -
 176+
 177+ $viewHtml .= Html::rawElement( 'div', array( 'class' => "filtered-$viewName $viewid" ), $view->getResultText() );
 178+
179179 $viewHandlers[$viewName] = null;
180180 $viewElements[$viewName][] = $viewid;
181181 }
182182 }
183 -
 183+
184184 // wrap views in a div
185185 $viewHtml = Html::rawElement( 'div', array( 'class' => 'filtered-views' ), $viewHtml );
186 -
 186+
187187 // Define the srf_filtered_values array
188188 SMWOutputs::requireScript( 'srf_filtered_values', Html::inlineScript(
189189 'srf_filtered_values = {};'
@@ -199,23 +199,23 @@
200200 Html::inlineScript(
201201 'srf_filtered_values["' . $id . '"] = { "values":' . json_encode( $resultAsArray ) .
202202 ', "data": {' .
203 - ' "viewhandlers" : ' . json_encode( $viewHandlers ) .
204 - ', "viewelements" : ' . json_encode( $viewElements ) .
205 - ', "filterhandlers" : ' . json_encode( $filterHandlers ) .
206 - ', "filterdata" : ' . json_encode( $filterData ) .
 203+ ' "viewhandlers" : ' . json_encode( $viewHandlers ) .
 204+ ', "viewelements" : ' . json_encode( $viewElements ) .
 205+ ', "filterhandlers" : ' . json_encode( $filterHandlers ) .
 206+ ', "filterdata" : ' . json_encode( $filterData ) .
207207 '}};'
208208 )
209209 );
210 -
211 - SMWOutputs::requireResource('ext.srf.filtered');
212210
 211+ SMWOutputs::requireResource( 'ext.srf.filtered' );
 212+
213213 // wrap all in a div
214214 $html = Html::rawElement( 'div', array( 'class' => 'filtered ' . $id ), $filterHtml . $viewHtml );
215 -
 215+
216216 return $html;
217217 }
218218
219 -
 219+
220220 public function getParameters() {
221221 $params = array_merge( parent::getParameters(),
222222 parent::textDisplayParameters() );
@@ -225,14 +225,14 @@
226226 $params['views']->setDefault( '' );
227227
228228 foreach ( $this->mViewTypes as $viewType ) {
229 - $params = array_merge($params, call_user_func( array( $viewType, 'getParameters') ) );
 229+ $params = array_merge( $params, call_user_func( array( $viewType, 'getParameters' ) ) );
230230 }
231 -
 231+
232232 return $params;
233233 }
234234
235235 public function getLinker( $firstcol = false, $force = false ) {
236236 return ( $force ) ? $this->mLinker : parent::getLinker( $firstcol );
237237 }
238 -
 238+
239239 }