本文整理汇总了PHP中CCourse::GetCourseContent方法的典型用法代码示例。如果您正苦于以下问题:PHP CCourse::GetCourseContent方法的具体用法?PHP CCourse::GetCourseContent怎么用?PHP CCourse::GetCourseContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCourse
的用法示例。
在下文中一共展示了CCourse::GetCourseContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetDataWoCache
protected static function GetDataWoCache($courseId)
{
$rsContent = CCourse::GetCourseContent($courseId, array(), array('LESSON_ID', 'NAME'));
$arContents = array();
while ($arContent = $rsContent->GetNext()) {
$arContents[] = $arContent;
}
return $arContents;
}
示例2: array
// Resolve links "?COURSE_ID={SELF}". Don't relay on it, this behaviour
// can be changed in future without any notifications.
if (isset($arChapter['DETAIL_TEXT'])) {
$arChapter['DETAIL_TEXT'] = CLearnHelper::PatchLessonContentLinks($arChapter['DETAIL_TEXT'], $arParams['COURSE_ID']);
}
if (isset($arChapter['PREVIEW_TEXT'])) {
$arChapter['PREVIEW_TEXT'] = CLearnHelper::PatchLessonContentLinks($arChapter['PREVIEW_TEXT'], $arParams['COURSE_ID']);
}
// Self test page URL
$arChapter["SELF_TEST_URL"] = CComponentEngine::MakePathFromTemplate($arParams["SELF_TEST_TEMPLATE"], array("LESSON_ID" => $arParams["CHAPTER_ID"], "SELF_TEST_ID" => $arParams["CHAPTER_ID"], "COURSE_ID" => $arParams["COURSE_ID"]));
//Self test exists?
$rsQuestion = CLQuestion::GetList(array(), array("LESSON_ID" => $arParams["CHAPTER_ID"], "ACTIVE" => "Y", "SELF" => "Y"));
$arChapter["SELF_TEST_EXISTS"] = (bool) $rsQuestion->Fetch();
$arResult = array("COURSE" => $arCourse, "CHAPTER" => $arChapter, "CONTENTS" => array());
//Included chapters and lessons
$rsContent = CCourse::GetCourseContent($arParams["COURSE_ID"], array());
$foundChapter = false;
while ($arContent = $rsContent->GetNext()) {
if ($foundChapter) {
if ($arContent["DEPTH_LEVEL"] <= $baseDepthLevel) {
break;
}
$arContent["DEPTH_LEVEL"] -= $baseDepthLevel;
if ($arContent["TYPE"] == "CH") {
$arContent["URL"] = CComponentEngine::MakePathFromTemplate($arParams["CHAPTER_DETAIL_TEMPLATE"], array("CHAPTER_ID" => '0' . $arContent["ID"], "COURSE_ID" => $arParams["COURSE_ID"]));
} else {
$arContent["URL"] = CComponentEngine::MakePathFromTemplate($arParams["LESSON_DETAIL_TEMPLATE"], array("LESSON_ID" => $arContent["ID"], "COURSE_ID" => $arParams["COURSE_ID"]));
}
$arResult["CONTENTS"][] = $arContent;
}
if ($arContent["ID"] == $arParams["CHAPTER_ID"] && $arContent["TYPE"] == "CH") {
示例3: ShowError
ShowError(GetMessage("LEARNING_COURSE_DENIED"));
return;
}
//Images
$arCourse["PREVIEW_PICTURE_ARRAY"] = CFile::GetFileArray($arCourse["PREVIEW_PICTURE"]);
// Resolve links "?COURSE_ID={SELF}". Don't relay on it, this behaviour
// can be changed in future without any notifications.
if (isset($arCourse['DETAIL_TEXT'])) {
$arCourse['DETAIL_TEXT'] = CLearnHelper::PatchLessonContentLinks($arCourse['DETAIL_TEXT'], $arParams["COURSE_ID"]);
}
if (isset($arCourse['PREVIEW_TEXT'])) {
$arCourse['PREVIEW_TEXT'] = CLearnHelper::PatchLessonContentLinks($arCourse['PREVIEW_TEXT'], $arParams["COURSE_ID"]);
}
//arResult
$arResult = array("COURSE" => $arCourse, "CONTENTS" => array());
$rsContent = CCourse::GetCourseContent($arParams["COURSE_ID"], array("DETAIL_TEXT", "DETAIL_TEXT_TYPE", "DETAIL_PICTURE", "PREVIEW_PICTURE"));
while ($arContent = $rsContent->GetNext()) {
$arContent["DETAIL_PICTURE_ARRAY"] = CFile::GetFileArray($arContent["DETAIL_PICTURE"]);
$arContent["PREVIEW_PICTURE_ARRAY"] = CFile::GetFileArray($arContent["PREVIEW_PICTURE"]);
// Resolve links "?COURSE_ID={SELF}". Don't relay on it, this behaviour
// can be changed in future without any nitifications.
if (isset($arContent['DETAIL_TEXT'])) {
$arContent['DETAIL_TEXT'] = CLearnHelper::PatchLessonContentLinks($arContent['DETAIL_TEXT'], $arParams["COURSE_ID"]);
}
if (isset($arContent['PREVIEW_TEXT'])) {
$arContent['PREVIEW_TEXT'] = CLearnHelper::PatchLessonContentLinks($arContent['PREVIEW_TEXT'], $arParams["COURSE_ID"]);
}
$arResult["CONTENTS"][] = $arContent;
}
unset($rsContent);
unset($arContent);