type = $type; $this->Doc = $Doc; $this->DBObj(); } function setSearchString($data) { $this->search_data = (array)$data; $this->search_data['str'] = trim($this->search_data['str']); return true; } function getSearchObj() { $search = SiteMap::getObj('Search/Search.php', null, $this->Doc); return $search; } function getList4Grid($opt = array()) { $start = 0; $ipp = 0; $where = ''; $ipp = 1024; extract($opt); $list = array(); $Search = $this->getSearchObj();; $Search->setSearchString($this->search_data); switch ($this->type) { case 'pages': $items = $Search->_getList4Pages($opt); $this->part_name = "site pages"; break; case 'emails': $items = $Search->_getList4Emails($opt); $this->part_name = "broadcast emails archive"; break; case 'announcements': $items = $Search->_getList4Announcements($opt); $this->part_name = "announcements"; break; default: $items = array(); } $this->section_tpl = $items['tpl']; $list['list'] = $items['items']; $list['num_rows'] = $items['num_rows']; $list['num_pages'] = $items['num_pages']; return $list; } }