m_caption = ( $caption !== false ) ? $caption : $uservalue; if ( $errormsg !== '' ) { $this->addErrorMsg( $errormsg ); } } protected function parseUserValue( $value ) { if ( $this->m_caption === false ) { $this->m_caption = $value; } $this->addErrorMsg( [ 'smw-datavalue-parse-error', $value ] ); } /** * @see SMWDataValue::loadDataItem() * @param $dataitem SMWDataItem * @return boolean */ protected function loadDataItem( SMWDataItem $dataItem ) { if ( $dataItem->getDIType() == SMWDataItem::TYPE_ERROR ) { $this->addError( $dataItem->getErrors() ); $this->m_caption = $this->getErrorText(); return true; } else { return false; } } public function getShortWikiText( $linked = null ) { return $this->m_caption; } public function getShortHTMLText( $linker = null ) { return htmlspecialchars( $this->getShortWikiText( $linker ) ); } public function getLongWikiText( $linked = null ) { return $this->getErrorText(); } public function getLongHTMLText( $linker = null ) { return $this->getErrorText(); } public function getWikiValue() { if ( $this->m_dataitem !== null ) { return $this->m_dataitem->getString(); } return $this->getErrorText(); } public function isValid() { return false; } }