Public Member Functions | |
| __construct () | |
| Constructor. | |
| execute ($query) | |
| Main entry point for Special Pages. | |
Static Protected Member Functions | |
| static | addAutoComplete () |
| Creates the JS needed for adding auto-completion to queryForm(). | |
Private Member Functions | |
| displaySearchByProperty () | |
| Returns the HTML for the complete search by property. | |
| displayResults ($results, $number=-1, $first=true, $highlight=false) | |
| Creates the HTML for a bullet list with all the results of the set query. | |
| getNavigationBar ($count) | |
| Creates the HTML for a Navigation bar for too many results. | |
| getExactResults () | |
| Returns all results that have exactly the value on the property. | |
| getNearbyResults ($count, $greater=true) | |
| Returns all results that have a value near to the searched for value on the property, ordered, and sorted by ending with the smallest one. | |
| queryForm () | |
| Creates the HTML for the query form for this special page. | |
Private Attributes | |
| $propertystring = '' | |
| string Name of the property searched for | |
| $property = null | |
| SMWPropertyValue The property that is searched for. | |
| $valuestring = '' | |
| string Name of the value that is searched for | |
| $value = null | |
| SMWDataValue The value that is searched for. | |
| $limit = 20 | |
| How many results should be displayed. | |
| $offset = 0 | |
| At what position are we currently. | |
a typed backlink. For example, it shows me all persons born in Croatia, or all winners of the Academy Award for best actress.
Definition at line 24 of file SMW_SpecialSearchByProperty.php.
| SMWSearchByProperty::__construct | ( | ) |
| SMWSearchByProperty::execute | ( | $ | query | ) |
Main entry point for Special Pages.
Gets all required parameters.
| [in] | $query | string Given by MediaWiki |
Definition at line 51 of file SMW_SpecialSearchByProperty.php.
References SMWOutputs::commitToOutputPage(), SMWInfolink::decodeParameters(), displaySearchByProperty(), SMWPropertyValue::makeUserProperty(), SMWDataValueFactory::newPropertyObjectValue(), and queryForm().
| SMWSearchByProperty::displaySearchByProperty | ( | ) | [private] |
Returns the HTML for the complete search by property.
Definition at line 104 of file SMW_SpecialSearchByProperty.php.
References $smwgSearchByPropertyFuzzy, displayResults(), getExactResults(), getNavigationBar(), getNearbyResults(), and smwfGetLinker().
Referenced by execute().
| SMWSearchByProperty::displayResults | ( | $ | results, | |
| $ | number = -1, |
|||
| $ | first = true, |
|||
| $ | highlight = false | |||
| ) | [private] |
Creates the HTML for a bullet list with all the results of the set query.
| [in] | $results | array of array of SMWWikiPageValue, SMWDataValue The entity and its datavalue |
| [in] | $number | int How many results should be displayed? -1 for all |
| [in] | $first | bool If less results should be displayed than given, should they show the first $number results, or the last $number results? |
| [in] | $highlight | bool Should the results be highlighted? |
Definition at line 187 of file SMW_SpecialSearchByProperty.php.
References SMWInfolink::newBrowsingLink(), and smwfGetLinker().
Referenced by displaySearchByProperty().
| SMWSearchByProperty::getNavigationBar | ( | $ | count | ) | [private] |
Creates the HTML for a Navigation bar for too many results.
Most of the parameters are taken from the object members.
| [in] | $count | int How many results are currently displayed? |
Definition at line 231 of file SMW_SpecialSearchByProperty.php.
References $smwgQMaxInlineLimit.
Referenced by displaySearchByProperty().
| SMWSearchByProperty::getExactResults | ( | ) | [private] |
Returns all results that have exactly the value on the property.
Definition at line 322 of file SMW_SpecialSearchByProperty.php.
References SMWDataValueFactory::newDataItemValue(), and smwfGetStore().
Referenced by displaySearchByProperty().
| SMWSearchByProperty::getNearbyResults | ( | $ | count, | |
| $ | greater = true | |||
| ) | [private] |
Returns all results that have a value near to the searched for value on the property, ordered, and sorted by ending with the smallest one.
| [in] | $count | int How many entities have the exact same value on the property? |
| [in] | $greater | bool Should the values be bigger? Set false for smaller values |
Definition at line 350 of file SMW_SpecialSearchByProperty.php.
References SMWQueryProcessor::addThisPrintout(), SMWQueryProcessor::createQuery(), SMWQueryProcessor::getProcessedParams(), SMWQuery::MODE_INSTANCES, SMWPrintRequest::PRINT_PROP, smwfGetStore(), and SMWQueryProcessor::SPECIAL_PAGE.
Referenced by displaySearchByProperty().
| SMWSearchByProperty::queryForm | ( | ) | [private] |
Creates the HTML for the query form for this special page.
Definition at line 407 of file SMW_SpecialSearchByProperty.php.
Referenced by execute().
| static SMWSearchByProperty::addAutoComplete | ( | ) | [static, protected] |
Creates the JS needed for adding auto-completion to queryForm().
Uses the MW API to fetch suggestions.
Definition at line 424 of file SMW_SpecialSearchByProperty.php.
References END, SMWOutputs::requireResource(), SMWOutputs::requireScript(), and public::response().
SMWSearchByProperty::$propertystring = '' [private] |
string Name of the property searched for
Definition at line 27 of file SMW_SpecialSearchByProperty.php.
SMWSearchByProperty::$property = null [private] |
SMWPropertyValue The property that is searched for.
Definition at line 29 of file SMW_SpecialSearchByProperty.php.
SMWSearchByProperty::$valuestring = '' [private] |
string Name of the value that is searched for
Definition at line 31 of file SMW_SpecialSearchByProperty.php.
SMWSearchByProperty::$value = null [private] |
SMWDataValue The value that is searched for.
Definition at line 33 of file SMW_SpecialSearchByProperty.php.
SMWSearchByProperty::$limit = 20 [private] |
How many results should be displayed.
Definition at line 35 of file SMW_SpecialSearchByProperty.php.
SMWSearchByProperty::$offset = 0 [private] |
1.5.6