lwb5-in-2025/scripts/game/main/manual/library/getStructure.inc

25 lines
556 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class main_manual_getStructure {
function __construct($lib) {
2016-01-10 11:01:49 +01:00
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->version = $this->lib->mainClass->version;
}
function run($lang) {
// Get the manual's root node identifier
$q = $this->db->query("SELECT id FROM man_section WHERE version='{$this->version}' AND lang='$lang' AND in_section IS NULL");
if (!($q && dbCount($q) == 1)) {
return array();
}
list($rootId) = dbFetchArray($q);
// List sections
return $this->lib->call('getSectionsIn', $rootId, 2);
}
}
?>