public function __construct(LingoMessageLog &$messages = null) { parent::__construct($messages); // get the store $store = smwfGetStore(); // Create query $desc = new SMWSomeProperty(new SMWDIProperty('___glt'), new SMWThingDescription()); $desc->addPrintRequest(new SMWPrintRequest(SMWPrintRequest::PRINT_PROP, null, SMWPropertyValue::makeProperty('___glt'))); $desc->addPrintRequest(new SMWPrintRequest(SMWPrintRequest::PRINT_PROP, null, SMWPropertyValue::makeProperty('___gld'))); $desc->addPrintRequest(new SMWPrintRequest(SMWPrintRequest::PRINT_PROP, null, SMWPropertyValue::makeProperty('___gll'))); $query = new SMWQuery($desc, false, false); $query->sort = true; $query->sortkeys['___glt'] = 'ASC'; // get the query result $this->mQueryResult = $store->getQueryResult($query); }
public function __construct(LingoMessageLog &$messages = null) { global $wgexLingoPage; $page = $wgexLingoPage ? $wgexLingoPage : wfMsgForContent('lingo-terminologypagename'); parent::__construct($messages); // Get Terminology page $title = Title::newFromText($page); if ($title->getInterwiki()) { $this->getMessageLog()->addError(wfMsgForContent('lingo-terminologypagenotlocal', $page)); return false; } $rev = Revision::newFromTitle($title); if (!$rev) { $this->getMessageLog()->addWarning(wfMsgForContent('lingo-noterminologypage', $page)); return false; } $content = $rev->getText(); $this->mArticleLines = array_reverse(explode("\n", $content)); }