/** * Generate a Table of Contents for an specific section */ function rd_generate_toc() { $id = rmc_server_var($_GET, 'id', 0); $number = rmc_server_var($GLOBALS, 'rd_section_number', 0); if ($id <= 0) { return; } $sec = new RDSection($id); if ($sec->isNew()) { return; } $toc = RDFunctions::get_section_tree($id, new RDResource($sec->getVar('id_res')), $number); ob_start(); include RMEvents::get()->run_event('docs.template.toc', RMTemplate::get()->get_template('specials/rd_toc.php', 'module', 'docs')); $ret = ob_get_clean(); return $ret; }
/** * This function create a page to print or pdf. */ function rd_section_forprint($all = 0) { global $section, $res, $xoopsConfig; include 'header.php'; $xoops_langcode = $xoopsTpl->get_template_vars('xoops_langcode'); $xoops_charset = $xoopsTpl->get_template_vars('xoops_charset'); $xoops_pagetitle = $xoopsTpl->get_template_vars('xoops_pagetitle'); $xoops_sitename = $xoopsTpl->get_template_vars('xoops_sitename'); $xoops_css = $xoopsTpl->get_template_vars('xoops_themecss'); if ($all) { $toc = array(); RDFunctions::sections_tree_index(0, 0, $res, '', '', false, $toc, true); include RMEvents::get()->run_event('docs.print.template', RMTemplate::get()->get_template('rd_printsection.php', 'module', 'docs')); } else { $toc = RDFunctions::get_section_tree($section->id(), $res, '1', true); include RMEvents::get()->run_event('docs.print.template', RMTemplate::get()->get_template('rd_printsection.php', 'module', 'docs')); } }