/** * @return string[] List of pagename */ public function &getAllUserPages() { $WikiPageAdminPages = WikiPage::getAdminPages(); $WikiPageDefaultPages = WikiPage::getDefaultPages(); $allPages = array(); $res = db_query(' SELECT pagename' . ' FROM wiki_page, wiki_nonempty' . ' WHERE wiki_page.group_id="' . db_ei($this->gid) . '"' . ' AND wiki_nonempty.id=wiki_page.id' . ' AND wiki_page.pagename NOT IN ("' . implode('","', $WikiPageDefaultPages) . '", "' . implode('","', $WikiPageAdminPages) . '")'); while ($row = db_fetch_array($res)) { $allPages[] = $row[0]; } return $allPages; }
/** * Get number of project wiki pages. * @return number of project pages (0 if wiki is empty) */ function getProjectPageCount() { $res = db_query(' SELECT count(*) as count' . ' FROM wiki_page, wiki_nonempty' . ' WHERE wiki_page.group_id="' . $this->gid . '"' . ' AND wiki_nonempty.id=wiki_page.id' . ' AND wiki_page.pagename NOT IN ("' . implode('","', WikiPage::getDefaultPages()) . '", "' . implode('","', WikiPage::getAdminPages()) . '")'); if (db_numrows($res) > 0) { return db_result($res, 0, 'count'); } else { return 0; } }
public function doesWikiPageExistInRESTContext($page_id) { $admin_pages = $this->da->quoteSmartImplode(',', WikiPage::getAdminPages()); $default_pages = $this->da->quoteSmartImplode(',', WikiPage::getDefaultPages()); $page_id = $this->da->escapeInt($page_id); $sql = "SELECT SQL_CALC_FOUND_ROWS wiki_page.id\n FROM wiki_page, wiki_nonempty\n WHERE wiki_page.id = {$page_id}\n AND wiki_nonempty.id <> wiki_page.id\n AND wiki_page.pagename NOT IN ({$default_pages},{$admin_pages})"; $this->retrieve($sql); return (int) $this->foundRows(); }