This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/main/manual/library/getStructure.inc

24 lines
569 B
PHP

<?php
class main_manual_getStructure {
function main_manual_getStructure($lib) {
$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);
}
}
?>