function handle($params) { import('Dataface/SearchForm.php'); $app =& Dataface_Application::getInstance(); $query =& $app->getQuery(); $new = true; $form = new Dataface_SearchForm($query['-table'], $app->db(), $query); $res = $form->_build(); if (PEAR::isError($res)) { trigger_error($res->toString() . Dataface_Error::printStackTrace(), E_USER_ERROR); } /* * * We need to add the current GET parameter flags (the GET vars starting with '-') so * that the controller knows to pass control to this method again upon form submission. * */ $form->setDefaults(array('-action' => $query['-action'])); if ($form->validate()) { $res = $form->process(array(&$form, 'performFind')); } $jt = Dataface_JavascriptTool::getInstance(); $jt->import('find.js'); ob_start(); $form->display(); $out = ob_get_contents(); ob_end_clean(); $context = array('form' => &$out); df_display($context, 'Dataface_Find_View.html', true); }
function handle($params) { import('Dataface/SearchForm.php'); $app =& Dataface_Application::getInstance(); $query =& $app->getQuery(); $new = true; $form = new Dataface_SearchForm($query['-table'], $app->db(), $query); $res = $form->_build(); if (PEAR::isError($res)) { trigger_error($res->toString() . Dataface_Error::printStackTrace(), E_USER_ERROR); } /* * * We need to add the current GET parameter flags (the GET vars starting with '-') so * that the controller knows to pass control to this method again upon form submission. * */ $form->setDefaults(array('-action' => $query['-action'])); if ($form->validate()) { $res = $form->process(array(&$form, 'performFind')); } $app->addHeadContent(sprintf(<<<END \t\t\t<link rel="stylesheet" type="text/css" href="%s"/> \t\t\t<link rel="stylesheet" type="text/css" href="%s"/> \t\t\t<script>if ( typeof(jQuery) == 'undefined' ){document.writeln('<'+'script src="%s"><'+'/script>');}</script> \t\t\t<script src="%s"></script> \t\t\t<script src="%s"></script> \t\t\t END , htmlspecialchars(DATAFACE_URL . '/css/smoothness/jquery-ui-1.7.2.custom.css'), htmlspecialchars(DATAFACE_URL . '/css/find.css'), htmlspecialchars(DATAFACE_URL . '/js/jquery.packed.js'), htmlspecialchars(DATAFACE_URL . '/js/jquery-ui-1.7.2.custom.min.js'), htmlspecialchars(DATAFACE_URL . '/js/find.js'))); ob_start(); $form->display(); $out = ob_get_contents(); ob_end_clean(); $context = array('form' => &$out); df_display($context, 'Dataface_Find_View.html', true); }
/** * Displays find form. */ function _find() { import('Dataface/SearchForm.php'); $form = new Dataface_SearchForm($this->_tablename, $this->_db, $this->_query); ob_start(); $form->display(); $out = ob_get_contents(); ob_end_clean(); return $out; }