本文整理汇总了PHP中WikiPage::getError方法的典型用法代码示例。如果您正苦于以下问题:PHP WikiPage::getError方法的具体用法?PHP WikiPage::getError怎么用?PHP WikiPage::getError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WikiPage
的用法示例。
在下文中一共展示了WikiPage::getError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Wiki
$wiki = new Wiki($con, $config);
$wiki->setTitle($wikiTitle);
$wiki->setDescription($wikiDesc);
$wiki->setACL($wikiACL);
$wiki->setGroupId($groupId);
$wikiId = $wiki->save();
//notify wiki modification
$eventNotifier->notifyCourseEvent('wiki_added', claro_get_current_course_id(), claro_get_current_tool_id(), $wikiId, claro_get_current_group_id(), '0');
$mainPageContent = sprintf(get_lang("This is the main page of the Wiki %s. Click on '''Edit''' to modify the content."), $wikiTitle);
$wikiPage = new WikiPage($con, $config, $wikiId);
if ($wikiPage->create($creatorId, '__MainPage__', $mainPageContent, date("Y-m-d H:i:s"), true)) {
$message = get_lang("Wiki creation succeed");
$dialogBox->success($message);
} else {
$message = get_lang("Wiki creation failed");
$dialogBox->error($message . ":" . $wikiPage->getError());
}
} elseif ($wikiStore->wikiIdExists($wikiId)) {
$wiki = $wikiStore->loadWiki($wikiId);
$wiki->setTitle($wikiTitle);
$wiki->setDescription($wikiDesc);
$wiki->setACL($wikiACL);
$wiki->setGroupId($groupId);
$wikiId = $wiki->save();
//notify wiki creation
$eventNotifier->notifyCourseEvent('wiki_modified', claro_get_current_course_id(), claro_get_current_tool_id(), $wikiId, claro_get_current_group_id(), '0');
if ($wikiId) {
$message = get_lang("Wiki edition succeed");
$dialogBox->success($message);
} else {
$message = get_lang("Wiki edition failed");
示例2: date
$content = $wikiPage->getContent();
$changelog = $langWikiPageRevertedVersion;
$versionId = 0;
}
if (isset($content)) {
$time = date('Y-m-d H:i:s');
if ($wikiPage->pageExists($wiki_title)) {
$wikiPage->loadPage($wiki_title);
if ($content == $wikiPage->getContent()) {
$message = $langWikiIdenticalContent;
$style = 'caution';
$action = 'show';
} else {
$wikiPage->edit($creatorId, $content, $changelog, $time, true);
if ($wikiPage->hasError()) {
$message = "Database error : " . $wikiPage->getError();
$style = "caution";
} else {
$message = $langWikiPageSaved;
$style = "success";
}
$action = 'show';
}
} else {
$wikiPage->create($creatorId, $wiki_title, $content, $changelog, $time, true);
if ($wikiPage->hasError()) {
$message = 'Database error : ' . $wikiPage->getError();
$style = 'caution';
} else {
$message = $langWikiPageSaved;
$style = 'success';
示例3: date
$time = date("Y-m-d H:i:s");
if ($wikiPage->pageExists($title)) {
$wikiPage->loadPage($title);
if ($content == $wikiPage->getContent()) {
unset($_SESSION['wikiLastVersion']);
$message = get_lang("Identical content<br />no modification saved");
$dialogBox->info($message);
$action = 'show';
} else {
if (isset($_SESSION['wikiLastVersion']) && $wikiPage->getLastVersionId() != $_SESSION['wikiLastVersion']) {
$action = 'conflict';
} else {
$wikiPage->edit($creatorId, $content, $time, true);
unset($_SESSION['wikiLastVersion']);
if ($wikiPage->hasError()) {
$message = get_lang("Database error : ") . $wikiPage->getError();
$dialogBox->error($message);
} else {
$message = get_lang("Page saved");
$dialogBox->success($message);
}
$action = 'show';
}
}
//notify modification of the page
$eventNotifier->notifyCourseEvent('wiki_page_modified', claro_get_current_course_id(), claro_get_current_tool_id(), $wikiId, claro_get_current_group_id(), '0');
} else {
$wikiPage->create($creatorId, $title, $content, $time, true);
if ($wikiPage->hasError()) {
$message = get_lang("Database error : ") . $wikiPage->getError();
$dialogBox->error($message);