$text->addSoftkey('2', 'T9', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=t9'); $text->addSoftkey('3', 'Help', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=help'); $text->addSoftkey('6', 'Exit', 'SoftKey:Exit'); $text->output(); break; } //step3: if we do have a search term, see if there are any contacts for said term } elseif (!$contact) { $contacts = search($search); if ($contacts) { $menu->setTitle('Please select a contact'); $menu->setDestroyOnExit(); foreach ($contacts as $contact => $val) { $menu->addEntry($val['first_name'] . ' ' . $val['last_name'], $XML_SERVER_PATH . 'contactdir.php?user='******'&contact=' . $val['id'] . '&searchmethod=' . $searchmethod . '&search=' . $search); } $menu->natsortByName(); $menu->addSoftkey('3', 'Exit', 'SoftKey:Exit'); $menu->addSoftkey('5', 'Back', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=' . $searchmethod . '&searchterm=' . $search); $menu->addSoftkey('6', 'Select', 'SoftKey:Select'); $menu->output(); } else { //if no contacts are found, return error and prompt again /* $text->setTitle('Error'); $text->setText('No Matches Found!'); $text->setDestroyOnExit(); $text->setRefresh('3',$XML_SERVER_PATH.'contactdir.php?user='******'&searchmethod='.$searchmethod.'&searchterm='.$search); $text->addSoftKey('6','','SoftKey:Exit'); //hide default buttons $text->output(); */ $screen->setdestroyOnExit();