Example #1
0
/**
 * Reads the Help articles from default db and returns the array of pages.
 */
function getWikiHelpPages()
{
    $help_pages = array();
    require_once BASE_DIR . "/models/datasources/sqlite3_manager.php";
    $default_dbm = new Sqlite3Manager();
    $default_dbm->connect("", "", "", BASE_DIR . "/data/default.db");
    if (!$default_dbm) {
        return false;
    }
    $group_model = new GroupModel(DB_NAME, true);
    $group_model->db = $default_dbm;
    $page_list = $group_model->getPageList(HELP_GROUP_ID, "en-US", '', 0, 200);
    foreach ($page_list[1] as $page) {
        if (isset($page['TITLE'])) {
            $page_info = $group_model->getPageInfoByName(HELP_GROUP_ID, $page['TITLE'], "en-US", "api");
            $page_content = str_replace("&", "&", $page_info['PAGE']);
            $page_content = html_entity_decode($page_content, ENT_QUOTES, "UTF-8");
            $help_pages[$page['TITLE']] = $page_content;
        }
    }
    return $help_pages;
}