CDBResult CChapter::GetTreeList( int COURSE_ID );
The GetTreeList method returns a sorted list of chapters as a fully expanded tree.
| Parameter | Description |
|---|---|
| COURSE_ID | The course ID. |
The method returns an instance of the CDBResult object.
<?
if (CModule::IncludeModule("learning"))
{
$res = CChapter::GetTreeList($COURSE_ID = 105);
while ($arChapter = $res->GetNext())
{
echo str_repeat(" ", $arChapter["DEPTH_LEVEL"]);
echo "+".$arChapter["NAME"]."<br>";
}
/*
The above example will output something similar to:
+Chapter 1
+Chapter 1.1
+Chapter 1.2
+Chapter 2
+Chapter 3
+Chapter 3.1
+Chapter 3.1.1
*/
}
?>| © 2001-2007 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |