function EmitWebLinks($journo_id) { print "<h3>Web links</h3>\n"; $links = WeblinkWidget::fetch_lots($journo_id, ''); foreach ($links as $l) { $w = new WeblinkWidget($l); $w->emit_full(); } /* cheesy form to add a link */ /* replace with widget-based version */ ?> <form method="post"> url: <input type="text" name="url" size="40" /> description: <input type="text" name="desc" size="40" /> <?php print form_element_hidden('action', 'add_link'); print form_element_hidden('journo_id', $journo_id); ?> <input type="submit" name="submit" value="Add Link" /> </form> <?php return; }
<p>Web links for journos</p> <form method="post" action=""> Show: <select name="status"> <option <?php echo $status == '' ? 'selected ' : ''; ?> value="">All</option> <option <?php echo $status == 'unapproved' ? 'selected ' : ''; ?> value="unapproved">Unapproved</option> <option <?php echo $status == 'approved' ? 'selected ' : ''; ?> value="approved">Approved</option> </select> <input type="submit" name="submit" value="Filter" /> </form> <?php $rows = WeblinkWidget::fetch_lots(null, $status); foreach ($rows as $r) { $w = new WeblinkWidget($r); $w->emit_full(); } admPageFooter(); function ExtraHead() { WeblinkWidget::emit_head_js(); }