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