register_hook('TPL_ACT_RENDER', 'BEFORE', $this, 'handle_act_render', array()); $controller->register_hook('RENDERER_CONTENT_POSTPROCESS', 'AFTER', $this, 'handle_renderer_content_postprocess', array()); } /** * Make sure the other toc is not printed */ function handle_act_render(&$event, $param) { global $ID; global $INFO; if (p_get_metadata($ID, 'movetoc')) { $INFO['prependTOC'] = false; } } /** * Replace our placeholder with the actual toc content */ function handle_renderer_content_postprocess(&$event, $param) { global $TOC; if ($TOC) { $html = '