Exemplo n.º 1
0
// Delete empty sheet that may have been there.
$standard_sheet = "Standard";
$database_styles->deleteSheet($standard_sheet);
$database_styles->revokeWriteAccess("", $standard_sheet);
$database_styles->deleteSheet("");
$database_styles->createSheet($standard_sheet);
$database_styles->grantWriteAccess("admin", $standard_sheet);
Styles_Sheets::create_all();
// Set the export stylesheet to "Standard" for all Bibles and the admin.
$bibles = $database_bibles->getBibles();
foreach ($bibles as $bible) {
    $database_config_bible->setExportStylesheet($bible, $standard_sheet);
}
$database_config_user->setStylesheet($standard_sheet);
// Set the site language to "Default"
$database_config_general->setSiteLanguage(Locale_Logic::filterDefault("default"));
// Ensure the default users are there.
$users = array(array("guest", Filter_Roles::GUEST_LEVEL), array("member", Filter_Roles::MEMBER_LEVEL), array("consultant", Filter_Roles::CONSULTANT_LEVEL), array("translator", Filter_Roles::TRANSLATOR_LEVEL), array("manager", Filter_Roles::MANAGER_LEVEL), array("admin", Filter_Roles::ADMIN_LEVEL));
foreach ($users as $user) {
    if (!$database_users->usernameExists($user[0])) {
        $database_users->addNewUser($user[0], $user[0], $user[1], "");
    }
    $database_users->updateUserLevel($user[0], $user[1]);
}
// Ensure the KJV Bible exists.
$database_bibles->createBible("KJV");
$database_users->grantAccess2Bible("admin", $bible);
// Store some text into the KJV Bible.
$data = array();
$usfm = <<<'EOD'
\id JUD 65-JUD-kjv.sfm The King James Version of the Holy Bible Wednesday, October 14, 2009