示例#1
0
文件: search.php 项目: Niknox/aowow
 private function _searchItemset($cndBase, &$shared)
 {
     $result = [];
     $cnd = array_merge($cndBase, [is_int($this->query) ? ['id', $this->query] : $this->createLookup()]);
     $sets = new ItemsetList($cnd);
     if ($data = $sets->getListviewData()) {
         if ($this->searchMask & SEARCH_TYPE_REGULAR) {
             $this->extendGlobalData($sets->getJSGlobals(GLOBALINFO_SELF));
         }
         if ($this->searchMask & SEARCH_TYPE_OPEN) {
             foreach ($sets->iterate() as $__) {
                 $data[$sets->id]['param1'] = $sets->getField('quality');
             }
         }
         $result = array('type' => TYPE_ITEMSET, 'appendix' => ' (Item Set)', 'matches' => $sets->getMatches(), 'file' => ItemsetList::$brickFile, 'data' => $data, 'params' => []);
         $shared['pcsToSet'] = $sets->pieceToSet;
         if ($sets->getMatches() > $this->maxResults) {
             $result['params']['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_itemsetsfound', $sets->getMatches(), $this->maxResults);
             $result['params']['_truncated'] = 1;
         }
         if (isset($result['params']['note'])) {
             $result['params']['note'] .= ' + LANG.dash + $WH.sprintf(LANG.lvnote_filterresults, \'?itemsets&filter=na=' . urlencode($this->search) . '\')';
         } else {
             $result['params']['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?itemsets&filter=na=' . urlencode($this->search) . '\')';
         }
     }
     return $result;
 }
示例#2
0
 private function _searchItemset($cndBase, &$shared)
 {
     $cnd = array_merge($cndBase, [is_int($this->query) ? ['id', $this->query] : $this->createLookup()]);
     $sets = new ItemsetList($cnd);
     if ($data = $sets->getListviewData()) {
         if ($this->searchMask & SEARCH_TYPE_REGULAR) {
             $this->extendGlobalData($sets->getJSGlobals(GLOBALINFO_SELF));
         }
         $result['data'] = array_values($data);
         $osInfo = [TYPE_ITEMSET, ' (Item Set)', $sets->getMatches()];
         if ($this->searchMask & SEARCH_TYPE_OPEN) {
             foreach ($sets->iterate() as $id => $__) {
                 $osInfo[3][$id] = $sets->getField('quality');
             }
         }
         $shared['pcsToSet'] = $sets->pieceToSet;
         if ($sets->getMatches() > $this->maxResults) {
             $result['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_itemsetsfound', $sets->getMatches(), $this->maxResults);
             $result['_truncated'] = 1;
         }
         if (isset($result['note'])) {
             $result['note'] .= ' + LANG.dash + $WH.sprintf(LANG.lvnote_filterresults, \'?itemsets&filter=na=' . urlencode($this->search) . '\')';
         } else {
             $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?itemsets&filter=na=' . urlencode($this->search) . '\')';
         }
         return ['itemset', $result, null, $osInfo];
     }
     return false;
 }