本文整理汇总了PHP中CCourse::GetSite方法的典型用法代码示例。如果您正苦于以下问题:PHP CCourse::GetSite方法的具体用法?PHP CCourse::GetSite怎么用?PHP CCourse::GetSite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCourse
的用法示例。
在下文中一共展示了CCourse::GetSite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CCoursePackage
function CCoursePackage($COURSE_ID)
{
global $DB;
$this->ID = intval($COURSE_ID);
//Course exists?
$res = CCourse::GetByID($this->ID);
if (!($this->arCourse = $res->Fetch())) {
$this->LAST_ERROR = GetMessage("LEARNING_BAD_COURSE_ID_EX");
return false;
}
$res = CCourse::GetSite($this->ID);
if ($arSite = $res->GetNext()) {
$charset = $arSite["CHARSET"];
} else {
$this->LAST_ERROR = GetMessage("LEARNING_BAD_SITE_ID_EX");
return false;
}
//Define charset
if (strlen($charset) <= 0) {
if (defined("SITE_CHARSET") && strlen(SITE_CHARSET) > 0) {
$charset = SITE_CHARSET;
} else {
$charset = "windows-1251";
}
}
$this->charset = $charset;
//Get chapters, lessons, questions
$this->_GetCourseContent($this->arCourse['LESSON_ID']);
//Get tests
$strSql = "SELECT T.*, " . $DB->DateToCharFunction("T.TIMESTAMP_X") . " as TIMESTAMP_X " . "FROM b_learn_test T " . "WHERE T.COURSE_ID = " . intval($this->ID) . " " . "ORDER BY SORT ASC ";
$res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
while ($arRes = $res->Fetch()) {
$r = ++$this->RefID;
$this->arItems[$r] = $this->_CreateContent("TES", $arRes, $r);
$this->strItems .= '<item identifier="TES' . $r . '" identifierref="RES' . $r . '"><title>' . htmlspecialcharsbx($arRes["NAME"]) . '</title>';
$marksRes = $DB->Query("SELECT * FROM b_learn_test_mark WHERE TEST_ID = '" . (string) (int) $arRes['ID'] . "'", false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
while ($arMarksRes = $marksRes->Fetch()) {
$r = ++$this->RefID;
$this->arItems[$r] = $this->CreateTMK($arMarksRes, $r);
$this->strItems .= '<item identifier="TMK' . $r . '" identifierref="RES' . $r . '">' . '<title>' . htmlspecialcharsbx($arMarksRes['MARK'] . ' (' . $arMarksRes['DESCRIPTION'] . ')') . '</title>' . '</item>';
}
$this->strItems .= '</item>';
$this->strResourses .= '<resource identifier="RES' . $r . '" type="webcontent" href="res' . $r . '.xml">' . $this->_GetResourceFiles($r) . '</resource>';
}
}
示例2: array
} else {
$APPLICATION->SetTitle(GetMessage('LEARNING_ACCESS_D'));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$aContext = array(array("ICON" => "btn_list", "TEXT" => GetMessage("LEARNING_BACK_TO_ADMIN"), "LINK" => "learn_unilesson_admin.php?lang=" . LANG . '&PARENT_LESSON_ID=-1' . GetFilterParams("filter_"), "TITLE" => GetMessage("LEARNING_BACK_TO_ADMIN")));
$context = new CAdminContextMenu($aContext);
$context->Show();
CAdminMessage::ShowMessage(GetMessage("LEARNING_BAD_COURSE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
die;
}
}
if ($res === false || !$res->ExtractFields("str_")) {
$COURSE_ID = 0;
} else {
$str_SITE_ID = array();
$db_SITE_ID = CCourse::GetSite($COURSE_ID);
while ($ar_SITE_ID = $db_SITE_ID->Fetch()) {
$str_SITE_ID[] = $ar_SITE_ID["LID"];
}
}
require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/prolog_admin_after.php";
if ($bVarsFromForm) {
$str_SITE_ID = $SITE_ID;
$ACTIVE = $ACTIVE != "Y" ? "N" : "Y";
/**
* Resolving dependencies for new data structure
* was:
* $DB->InitTableVarsForEdit("b_learn_course", "", "str_");
*/
$arVarsOnForm = array('COURSE_ID', 'TIMESTAMP_X', 'ACTIVE_FROM', 'ACTIVE_TO', 'ACTIVE', 'CODE', 'NAME', 'SORT', 'RATING', 'RATING_TYPE', 'PREVIEW_TEXT', 'PREVIEW_TEXT_TYPE', 'PREVIEW_PICTURE', 'DETAIL_TEXT', 'DETAIL_TEXT_TYPE', 'DETAIL_PICTURE', 'DESCRIPTION', 'SCORM', 'LAUNCH');
foreach ($arVarsOnForm as $k => $varName) {
示例3: BuildList
public function BuildList()
{
global $USER;
$filterParams = GetFilterParams('filter_');
// list's footer
$this->oList->AddFooter(array(array('title' => GetMessage('MAIN_ADMIN_LIST_SELECTED'), 'value' => $this->rsData->SelectedRowsCount()), array('counter' => true, 'title' => GetMessage('MAIN_ADMIN_LIST_CHECKED'), 'value' => '0')));
$oParentPath = new CLearnPath();
if (isset($_GET['LESSON_PATH'])) {
$oParentPath->ImportUrlencoded($_GET['LESSON_PATH']);
}
$arParentPath = $oParentPath->GetPathAsArray();
// building list
while ($arRes = $this->rsData->NavNext(false)) {
$oCurPath = new CLearnPath();
$oCurPath->SetPathFromArray(array_merge($arParentPath, array($arRes['LESSON_ID'])));
$urlCurPath = $oCurPath->ExportUrlencoded();
unset($oCurPath);
// PUBLISH_PROHIBITED available in context of most parent course only
if ($this->contextCourseLessonId !== false) {
$arRes['PUBLISH_PROHIBITED'] = 'N';
if (CLearnLesson::IsPublishProhibited($arRes['LESSON_ID'], $this->contextCourseLessonId)) {
$arRes['PUBLISH_PROHIBITED'] = 'Y';
}
}
$arRes['SITE_ID'] = '';
$courseId = CLearnLesson::GetLinkedCourse($arRes['LESSON_ID']);
if ($courseId !== false) {
$hrefPrefix = 'learn_course_edit.php?COURSE_ID=' . $courseId;
$resCourseSites = CCourse::GetSite($courseId);
while ($arCourseSites = $resCourseSites->Fetch()) {
if ($arRes['SITE_ID'] != '') {
$arRes['SITE_ID'] .= ' / ';
}
$arRes['SITE_ID'] .= htmlspecialcharsbx($arCourseSites['LID']);
}
} else {
$hrefPrefix = 'learn_unilesson_edit.php?LESSON_ID=' . $arRes['LESSON_ID'] . '&LESSON_PATH=' . urlencode($urlCurPath);
}
$actionEditLesson = $hrefPrefix . '&lang=' . LANG . $filterParams;
$rowAction = false;
$rowTitle = '';
if (!$this->IsSearchMode()) {
$rowAction = 'learn_unilesson_admin.php?lang=' . LANG . '&set_filter=Y' . '&PARENT_LESSON_ID=' . ($arRes['LESSON_ID'] + 0) . '&LESSON_PATH=' . $urlCurPath . '&' . $this->hrefSearchRetPoint;
$rowTitle = GetMessage('LEARNING_TRAVERSE');
// "Traverse list of immediate childs"
if (!$arRes['IS_CHILDS']) {
$rowAction = $actionEditLesson;
$rowTitle = GetMessage('LEARNING_EDIT_TITLE');
}
}
$row =& $this->oList->AddRow($arRes['LESSON_ID'], $arRes, $rowAction, $rowTitle);
$arParents = $arChilds = array();
$htmlParents = $htmlChilds = '';
$rsParents = CLearnLesson::GetListOfImmediateParents($arRes['LESSON_ID'], array(), array('CHECK_PERMISSIONS' => 'N'));
while ($arParent = $rsParents->Fetch()) {
$arParents[] = $arParent['NAME'];
}
$arParents = array_map('htmlspecialcharsbx', $arParents);
if (count($arParents) > 0) {
$htmlParents = implode('<hr width="100%" size="1">', $arParents);
} else {
$htmlParents = ' ';
}
$rsChilds = CLearnLesson::GetListOfImmediateChilds($arRes['LESSON_ID'], array(), array('CHECK_PERMISSIONS' => 'N'));
while ($arChild = $rsChilds->Fetch()) {
$arChilds[] = $arChild['NAME'];
}
$arChilds = array_map('htmlspecialcharsbx', $arChilds);
if (count($arChilds) > 0) {
$htmlChilds = implode('<hr width="100%" size="1">', $arChilds);
} else {
$htmlChilds = ' ';
}
if (isset($arRes['LINKED_LESSON_ID']) && $arRes['LINKED_LESSON_ID'] > 0) {
$icon = 'learning_icon_courses';
} elseif (count($arChilds) > 0) {
$icon = 'learning_icon_chapters';
} else {
$icon = 'learning_icon_lessons';
}
if (!$this->IsSearchMode()) {
$row->AddViewField('NAME', '<span class="adm-list-table-icon-link"><span class="adm-submenu-item-link-icon adm-list-table-icon ' . $icon . '"></span>' . ($rowAction === false ? '<span class="adm-list-table-link">' . htmlspecialcharsbx($arRes['NAME']) . '</span>' : '<a href="' . $rowAction . '" class="adm-list-table-link">' . htmlspecialcharsbx($arRes['NAME']) . '</a>') . '</span>');
} else {
$actionUseLesson = "(function()\n\t\t\t\t\t{\n\t\t\t\t\t\tvar fnName = '" . str_replace(array("'", ';', ',', "\n", "\r"), '', htmlspecialcharsbx($this->search_retpoint)) . "';\n\t\t\t\t\t\tif ( ! (window.opener && window.opener[fnName]) )\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\twindow.opener[fnName]('" . (int) $arRes['LESSON_ID'] . "', '" . CUtil::JSEscape(htmlspecialcharsbx($arRes['NAME'])) . "');\n\t\t\t\t\t\twindow.close();\n\t\t\t\t\t})();\n\t\t\t\t\t";
$row->AddViewField('NAME', '<a href="javascript:void(0);" class="adm-list-table-icon-link" onclick="' . $actionUseLesson . '"><span class="adm-submenu-item-link-icon adm-list-table-icon ' . $icon . '"></span><span class="adm-list-table-link">' . htmlspecialcharsbx($arRes['NAME']) . '</span></a>');
}
$row->AddViewField('PARENTS', $htmlParents);
$row->AddEditField('PARENTS', ' ');
$row->AddViewField('CHILDS', $htmlChilds);
$row->AddEditField('CHILDS', ' ');
// this is very heavy statistic, so will be a good idea to add settings to the module, which turn off this statistics
$oLearnTree = CLearnLesson::GetTree($arRes['LESSON_ID']);
$arTree = $oLearnTree->GetTreeAsList();
$depth = -1;
$chapterCount = 0;
$lessonsCount = 0;
$questionsCount = CLQuestion::GetCount(array('LESSON_ID' => (int) $arRes['LESSON_ID']));
foreach ($arTree as $arLessonData) {
if ($arLessonData['IS_CHILDS']) {
++$chapterCount;
//.........这里部分代码省略.........