} ?> </ul> <?php } ?> <h1 id='title'><?php echo __(strip_tags($this->fuel->processHeadline ? $this->fuel->processHeadline : $page->get("title|name")), __FILE__); ?> </h1> <?php echo tabIndent($searchForm, 3); ?> </div> </div> <?php if (count($notices)) { include $config->paths->adminTemplates . "notices.inc"; } ?> <div id="content" class="content fouc_fix"> <div class="container"> <?php
protected function postProcessQuery($parentQuery) { if (count($this->extraOrSelectors)) { // there were embedded OR selectors where one of them must match // i.e. id>0, field=(selector string), field=(selector string) // in the above example at least one 'field' must match // the 'field' portion is used only as a group name and isn't // actually used as part of the resulting query or than to know // what groups should be OR'd together $sqls = array(); foreach ($this->extraOrSelectors as $groupName => $selectorGroup) { $n = 0; $sql = "\tpages.id IN (\n"; foreach ($selectorGroup as $selectors) { $pageFinder = new PageFinder(); $query = $pageFinder->find($selectors, array('returnQuery' => true, 'returnVerbose' => false, 'findAll' => true)); if ($n > 0) { $sql .= " \n\tOR pages.id IN (\n"; } $query->set('groupby', array()); $query->set('select', array('pages.id')); $query->set('orderby', array()); // foreach($this->nativeWheres as $where) $query->where($where); // doesn't seem to speed anything up, MySQL must already optimize for this $sql .= tabIndent("\t\t" . $query->getQuery() . "\n)", 2); $n++; } $sqls[] = $sql; } if (count($sqls)) { $sql = implode(" \n) AND (\n ", $sqls); $parentQuery->where("(\n{$sql}\n)"); } } /* Possibly move existing subselectors to work like this rather than how they currently are if(count($this->extraSubSelectors)) { $sqls = array(); foreach($this->extraSubSelectors as $fieldName => $selectorGroup) { $fieldName = $this->wire('database')->escapeCol($fieldName); $n = 0; $sql = "\tpages.id IN (\n"; foreach($selectorGroup as $selectors) { $pageFinder = new PageFinder(); $query = $pageFinder->find($selectors, array('returnQuery' => true, 'returnVerbose' => false)); if($n > 0) $sql .= " \n\tAND pages.id IN (\n"; $query->set('groupby', array()); $query->set('select', array('pages.id')); $query->set('orderby', array()); // foreach($this->nativeWheres as $where) $query->where($where); $sql .= tabIndent("\t\t" . $query->getQuery() . "\n)", 2); $n++; } $sqls[] = $sql; } if(count($sqls)) { $sql = implode(" \n) AND (\n ", $sqls); $parentQuery->where("(\n$sql\n)"); } } */ }