private function getValue($value, $escaped)
 {
     $this->value = DataValueFactory::getInstance()->newDataValueByProperty($this->property->getDataItem());
     $value = $this->unescape($value, $escaped);
     $this->value->setUserValue($value);
     return $this->value->isValid() ? $this->value->getWikiValue() : $value;
 }
Ejemplo n.º 2
0
 private function addExternalHelpLinks()
 {
     if ($this->getRequest()->getVal('printable') === 'yes') {
         return null;
     }
     // FIXME with SMW 3.0, allow to be used with MW 1.25-
     if (!method_exists($this, 'addHelpLink')) {
         return null;
     }
     if ($this->subjectDV->isValid()) {
         $link = SpecialPage::getTitleFor('ExportRDF', $this->subjectDV->getTitle()->getPrefixedText());
         $this->getOutput()->setIndicators(array(Html::rawElement('div', array('class' => 'mw-indicator smw-page-indicator-rdflink'), Html::rawElement('a', array('href' => $link->getLocalUrl('syntax=rdf')), 'RDF'))));
     }
     $this->addHelpLink(wfMessage('smw-specials-browse-helplink')->escaped(), true);
 }
 /**
  * @since 2.1
  */
 public function initialize()
 {
     $params = explode('/', $this->queryString);
     reset($params);
     // Remove empty elements
     $params = array_filter($params, 'strlen');
     $property = isset($this->requestOptions['property']) ? $this->requestOptions['property'] : current($params);
     $value = isset($this->requestOptions['value']) ? $this->requestOptions['value'] : next($params);
     $property = $this->urlEncoder->decode($property);
     $value = str_replace(array('-25'), array('%'), $value);
     $this->property = PropertyValue::makeUserProperty($property);
     if (!$this->property->isValid()) {
         $this->propertyString = $property;
         $this->value = null;
         $this->valueString = $value;
     } else {
         $this->propertyString = $this->property->getWikiValue();
         $this->value = DataValueFactory::getInstance()->newPropertyObjectValue($this->property->getDataItem(), $this->urlEncoder->decode($value));
         $this->valueString = $this->value->isValid() ? $this->value->getWikiValue() : $value;
     }
     $this->setLimit();
     $this->setOffset();
     $this->setNearbySearch();
 }