set('keystring', $input->in['keystring']); $help->delete(); build_user_help(); admin_flash_redirect('userhelp.php?do=modify'); } // ################################################################### if ($_REQUEST['do'] == 'delete') { $admin->page_confirm(T('Are you sure you want to delete help text?'), 'userhelp.php', 'kill', array('keystring' => $input->in['keystring'])); } // ################################################################### if ($_POST['do'] == 'insert') { $help = new UserHelpAPI(); $help->set('keystring', $input->in['keystring']); $help->set('title', $input->in['title']); $help->set('body', $input->in['body']); $help->insert(); admin_flash_redirect('userhelp.php?do=modify'); } // ################################################################### if ($_REQUEST['do'] == 'add') { BSTemplate::fetch('userhelp_add')->evaluate()->flush(); } // ################################################################### if ($_POST['do'] == 'update') { foreach ($input->in['help'] as $keystring => $fields) { $help = new UserHelpAPI(); $help->set('keystring', $keystring); $help->set('title', $fields['title']); $help->set('body', $fields['body']); $help->update(true, false); } build_user_help(); admin_flash_redirect('userhelp.php?do=modify'); } // ################################################################### if ($_REQUEST['do'] == 'modify') { $admin = new BSTemplate('userhelp'); $admin->vars['topics'] = $db->query("SELECT * FROM " . TABLE_PREFIX . "fieldhelp ORDER BY keystring ASC"); $admin->evaluate()->flush(); } ?>