public static function dispatch() { $id = get_http_var('id'); $action = get_http_var('action'); $sql = <<<EOT SELECT m.id,m.journo_id, j.ref, j.prettyname, j.oneliner, m.url, m.submitted, m.reason FROM missing_articles m LEFT JOIN journo j ON m.journo_id=j.id WHERE m.id=?; EOT; $row = db_getRow($sql, $id); $w = new MissingArticleWidget($row); // perform whatever action has been requested $w->perform($action); // is request ajax? $ajax = get_http_var('ajax') ? true : false; if ($ajax) { $w->emit_core(); } else { // not an ajax request, so output a full page admPageHeader("Missing Article", "MissingArticleWidget::emit_head_js"); print "<h2>Missing article</h2>\n"; $w->emit_full(); admPageFooter(); } }