/** * Shows the figures for a Document */ function rd_widget_figures() { global $res, $rmc_config; $ret['title'] = __('Document Figures', 'docs'); $count = 0; $figures = RDFunctions::figures($res->id(), &$count, '', 0, 6); $nav = new RMPageNav($count, 6, 1, 3); $nav->target_url('javascript:;" onclick="docsAjax.getFigures(' . $res->id() . ',6,{PAGE_NUM},\'rd-wd-figures\')'); RMTemplate::get()->add_script('../include/js/scripts.php?file=ajax.js'); ob_start(); ?> <div id="rd-wd-figures"> <ul> <?php if (count($figures) <= 0) { _e('There are not exists figures for this Document yet!', 'docs'); } foreach ($figures as $fig) { ?> <li><a href="javascript:;" onclick="docsAjax.insertIntoEditor('[figure:<?php echo $fig['id']; ?> ]','<?php echo $rmc_config['editor_type']; ?> ');"><?php echo $fig['title']; ?> </a></li> <?php } ?> </ul> <?php $nav->display(false); ?> </div> <?php $ret['content'] = ob_get_clean(); return $ret; }